问题
I'm currently working on a project that combines Java and .NET systems. The communication between the two is from Java over ActiveMQ to .NET MSMQ using BizTalk as a translator.
I was wondering if we could cut out BizTalk when using NServiceBus 4.0 and use 2 different transport types in 1 NServiceBus instance. Incoming events should be picked up from ActiveMQ and published using MSMQ.
The NServiceBus instance in this case is self-hosted within a WCF service on IIS and injected into the business logic using a Unity container.
Is this going to be possible or do I need to stick to 1 transport type per instance/host?
回答1:
With version 4.0 of NServiceBus, you can use ActiveMQ on both sides cutting out both BizTalk and MSMQ.
UPDATE:
You could have a regular NSB endpoint listening to ActiveMQ and have it call Bus.SendToSites where you configure the message to go out over MSMQ to your regular endpoints.
回答2:
We solved the issue by using a satellite in NServiceBus that uses Apache.NMS and Apache.NMS.ActiveMQ to consume an existing ActiveMQ queue and create a new message that we put on the bus. Using NServiceBus 4.0 default MSMQ transport and not mixing transports to consume the non-NServiceBus managed ActiveMQ.
回答3:
There is one transport per endpoint. As long as it is one way, you can expose your NSB endpoint as a web service.
来源:https://stackoverflow.com/questions/16729436/mixed-transports-in-nservicebus-4-0