0

I'm up to send and receive messages over ActiveMQ Artemis with C# applications. In Anycast-mode, everything is working.

When i tried to send and receive in multicast-mode, i can send, but i don't receive any of the messages from the queue.

I tried the trick from java, set the "multicast" flag before the tcp uri, but an error message shows up that there isn't an implementation for "multicast"

private void Receiver()
{
    IConnectionFactory factory = new NMSConnectionFactory("multicast:tcp://172.29.213.150:61616");
    IConnection connection = factory.CreateConnection("artemis", "simetraehcapa");
    connection.Start();
    ISession session = connection.CreateSession(AcknowledgementMode.AutoAcknowledge);
    IDestination destination = SessionUtil.GetDestination(session, "hund");
    IMessageConsumer receiver = session.CreateConsumer(destination);
    receiver.Listener += new MessageListener(Message_Listener);
}

Normally I would receive the messages, because I only switched from anycast to multicast, but actually I receive nothing.

Justin Bertram
  • 29,372
  • 4
  • 21
  • 43

1 Answers1

0

If using the AcitveMQ OpenWire NMS client you don't apply that odd multicast thing you've done to the URI, that will give you an error. The client should just work if you use the Session API and not that confusing SessionUtil API that has resulted in many people running into issues.

I'd use Session.CreateTopic to get an ITopic instance and then create a consumer using that which should map over into Artemis Multicast addresses without you needing to do anything. You do of course need to be subscribed before any messages are sent as Topics don't retain messages if no consumers are around when the are sent.

Tim Bish
  • 17,475
  • 4
  • 32
  • 42