Masstransit: Messages not recieved when using ActiveMQ and sending an instance of a class implementing the message interface

Created on 23 Apr 2019  路  14Comments  路  Source: MassTransit/MassTransit

Is this a bug report?

Yes

Can you also reproduce the problem with the latest version?

Yes. Tested with 5.5.0-develop.2000

Environment

  1. Operating system: Windows 10
  2. Visual Studio version: Visual Studio 2017
  3. Dotnet version: .Net Core 2.1

Steps to Reproduce

  1. Update host name and port for ActiveMQ host in Program.cs (Line 29)
  2. Update Username and Password in Program.cs (Line 32 and 32)
  3. Run the supplied test project

Expected Behavior

When the message of type MyMessage is published it should be consumed by the handler for IMyMessage interface. The testprogram will output "Publishing message" when the message is sent and "Recieved MyMessage: Hello" when the message is recieved. It works correctly using the InMemoryTransport

Actual Behavior

The message is not recieved by the handler so the test program does not output "Recieved MyMessage: Hello"

Reproducible Demo

https://github.com/DanielBck/MasstransitActiveMQTest1

activemq documentation

All 14 comments

This might be a limitation of the routing in ActiveMQ, I'd have to verify. Polymorphic messaging is only supported by RabbitMQ and the latest version for Azure Service Bus (.NET Core).

I have had a very similar issue with MassTransit.ActiveMQ 5.3.2 package where messages were not being received.

I could see that the publisher was able to publish and I could see the message enqueued, I could also see that the consumer was creating queues (or topics?) in ActiveMq, so clearly the problem was somewhere in the internal ActiveMQ routing.

It ended up being the name of the queue. If I name the consumer's queue (endpoint name) with something dot separated (e.g: My.Queue.Sample) the message never reached destination. If, however, I named it with something without dots (e.g: test_queue or myQueueSample it worked fine.

So there is a limitation/bug there (I haven't reported it but feel free to do so if your issue is related)

I see on your sample you're using a valid name, but just in case you've overlooked that detail and in your real application you're using an invalid one. I have been a few days fighting with this myself :)

PS: I also use interfaces as the message type being shared between publisher and consumer. The consumer does not know the real interface implementation at all.

@iberodev unsure why queue names with dots in them are invalid

Broker Name:
Must be unique in your AWS account.
Must be 1-50 characters long.
Must contain only characters specified in the ASCII Printable Character Set.
Can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~).

from https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/amazon-mq-limits.html supports

Also from scanning the ActiveMQ v5 documentations you can use dots as well

There are many special formats for queue and topic names using . in them, to support pub/sub in ActiveMQ. So it isn't so much that it's a limitation, it could be that having them is causing routing via topic/queue names to break.

@DanielBck did you manage to figure this out? I'm having the same issue

Seems to be abandoned, closing.

Having the same issue as @iberodev.
Can't have dots in ReceiveEndpoint queueName - pub/sub breaks. This should be documented, if it's a limitation of the ActiveMQ Transport.

Worth putting a validation warning/check in the receive endpoint? I can see legitimate needs to receive on a queue with dots, but that should disable any pub/sub configurations for that receive endpoint if that's the case I'm guessing.

Hello!
I use active mq doker image from masstransit authors (https://hub.docker.com/r/masstransit/activemq), but I want to use this version (https://hub.docker.com/r/vromero/activemq-artemis). If I connect to last, I'll can send messages to broker, but can't recieve these messages. What I need to do?

Does it work with the regular ActiveMQ broker?

Masstransit works fine with regular ActiveMQ, but doesn't work with Artemis version (but Apache says that activemq 5 and acivemq artemis are backward compatibility).

Well, clearly there is something different about them, not sure what it would be though. I haven't tried Artemis so I wouldn't know where to look. If you're using Publish, you might look if anything around VirtualTopic and VirtualConsumer changed.

Masstransit works fine with regular ActiveMQ, but doesn't work with Artemis version (but Apache says that activemq 5 and acivemq artemis are backward compatibility).

Hello!
Masstransit work fine with Artemis if change naming of queues.
(https://activemq.apache.org/components/artemis/migration-documentation/VirtualTopics.html)
E.g. It work fine for me, if name queues for consumer is
VirtualTopic.{EventType.FullName}::Consumer.{ConsumerType.Name}.VirtualTopic.{EventType.FullName}

Wow, and where does you change queue name with this pattern?

Was this page helpful?
0 / 5 - 0 ratings