0

We are looking at using ActiveMQ as the message transport with NServiceBus, instead of MSMQ, to enable Java endpoints to directly integrate with .NET endpoints over ActiveMQ.

By default NServiceBus endpoints run in a distributed transaction involving MSMQ and SQL Server. Is there the same level of support for distributed transactions in NServiceBus when the message transport is ActiveMQ? Are there any other drawbacks to using ActiveMQ with NServiceBus as compared to MSMQ?

bgrommes
  • 65
  • 4
  • Speaking from experience the active mq .net client has some major bugs. Not only do distributed transactions not work correctly but normal non distributed transactions have major bugs: https://issues.apache.org/jira/browse/AMQNET-476?jql=project%20%3D%20AMQNET%20AND%20resolution%20%3D%20Unresolved%20AND%20priority%20%3D%20Major%20ORDER%20BY%20key%20DESC. I would advise against using it for windows development. – Imran May 09 '14 at 14:13

2 Answers2

1

From the book Learning NServiceBus by David Boike:

Like MSMQ, ActiveMQ supports the DTC which ensures that our message handlers remain fully transactional.

As far as drawbacks go:

schellack
  • 10,144
  • 1
  • 29
  • 33
  • I've looked at the NServiceBus.ActiveMQ GitHub issue list. I was hoping for some deeper insight from folks who are either contributing to this project or have used distributed transactions with NServiceBus and ActiveMQ. – bgrommes Feb 14 '14 at 19:06
1

We've actually uncovered issues with the .net client of ActiveMQ - it doesn't support distributed transactions well enough. While we've tried to work with the committers over there, we still haven't been able to get this fully resolved.

At this point in time, if you want to use ActiveMQ on .net (with or without NServiceBus) you'll have to take care of deduplicating any messages flowing through your system.

We're working hard to build this kind of infrastructure-level deduplication logic into NServiceBus such that queues like RabbitMQ and Azure Service Bus that don't support distributed transactions give the same behavior as MSMQ.

Udi Dahan
  • 11,932
  • 1
  • 27
  • 35
  • There are cases where activemq will lose a message altogether, this is for both dtc and non dtc transactions. The bugs mainly exist around failover i.e. when the broker goes down and a slave takes over or if the broker restarts. – Imran May 09 '14 at 14:15