You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Mark Raynsford <li...@io7m.com.INVALID> on 2021/06/03 11:03:02 UTC

Unable to receive multicast messages

Hello!

I've been using Artemis for anycast queues for a couple of years now.
I've now come up against a problem that requires a multicast queue, so
I've been trying to put together some simple code that would let me
test a single-writer, multiple-consumer multicast address.

Unfortunately, I can't seem to get the consumers to receive any
messages.

Here's the code I'm using:

https://github.com/io7m/activemq-20210603/tree/master/src/main/java/com/io7m/mq

The writer writes messages to the "info.arc7.unrestricted.base" address.
I've tried setting the routing type to MULTICAST on individual
addresses, but this made no difference.

The reader creates an automatically-deleted queue called
"info.arc7.unrestricted.base.q" using "info.arc7.unrestricted.base"
as the address. It then goes into a loop performing a blocking
receive. It never receives anything.

In the server logs, I see messages such as:

2021-06-03 10:36:39,793 INFO  [org.apache.activemq.audit.message]
AMQ601500: User peppermint(amq)@10.2.4.1:50748 is sending a core
message with Context:
RoutingContextImpl(Address=info.arc7.unrestricted.base,
routingType=MULTICAST, PreviousAddress=info.arc7.unrestricted.base
previousRoute:MULTICAST, reusable=true, version=-2147483526)

In the web interface, I see that the "un routed message count" for
the "info.arc7.unrestricted.base" address is steadily rising, and the
"info.arc7.unrestricted.base.q" queue consistently has no messages in
it. The web view shows both address and queue as having a routing type
of MULTICAST.

Is there something else I'm supposed to do?

-- 
Mark Raynsford | https://www.io7m.com


Re: Unable to receive multicast messages

Posted by Mark Raynsford <li...@io7m.com.INVALID>.
On 2021-06-03T11:03:02 +0000
Mark Raynsford <li...@io7m.com> wrote:
> I've tried setting the routing type to MULTICAST on individual
> addresses, but this made no difference.

That was supposed to say "on individual messages".

-- 
Mark Raynsford | https://www.io7m.com


Re: Unable to receive multicast messages

Posted by Justin Bertram <jb...@apache.org>.
It looks to me like the problem is with this line [1] in your Writer. You
are setting the message expiration to a relative number (i.e. a duration)
when, in fact, the expiration is an absolute time. Therefore the message is
expiring before it even makes it into the queue. You should add
System.currentTimeMillis() to your duration and that should work.


Justin

[1]
https://github.com/io7m/activemq-20210603/blob/7a784f481781c6323a01bd498eb85f57d43dc098/src/main/java/com/io7m/mq/Writer.java#L55

On Thu, Jun 3, 2021 at 6:03 AM Mark Raynsford
<li...@io7m.com.invalid> wrote:

> Hello!
>
> I've been using Artemis for anycast queues for a couple of years now.
> I've now come up against a problem that requires a multicast queue, so
> I've been trying to put together some simple code that would let me
> test a single-writer, multiple-consumer multicast address.
>
> Unfortunately, I can't seem to get the consumers to receive any
> messages.
>
> Here's the code I'm using:
>
>
> https://github.com/io7m/activemq-20210603/tree/master/src/main/java/com/io7m/mq
>
> The writer writes messages to the "info.arc7.unrestricted.base" address.
> I've tried setting the routing type to MULTICAST on individual
> addresses, but this made no difference.
>
> The reader creates an automatically-deleted queue called
> "info.arc7.unrestricted.base.q" using "info.arc7.unrestricted.base"
> as the address. It then goes into a loop performing a blocking
> receive. It never receives anything.
>
> In the server logs, I see messages such as:
>
> 2021-06-03 10:36:39,793 INFO  [org.apache.activemq.audit.message]
> AMQ601500: User peppermint(amq)@10.2.4.1:50748 is sending a core
> message with Context:
> RoutingContextImpl(Address=info.arc7.unrestricted.base,
> routingType=MULTICAST, PreviousAddress=info.arc7.unrestricted.base
> previousRoute:MULTICAST, reusable=true, version=-2147483526)
>
> In the web interface, I see that the "un routed message count" for
> the "info.arc7.unrestricted.base" address is steadily rising, and the
> "info.arc7.unrestricted.base.q" queue consistently has no messages in
> it. The web view shows both address and queue as having a routing type
> of MULTICAST.
>
> Is there something else I'm supposed to do?
>
> --
> Mark Raynsford | https://www.io7m.com
>
>