You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by "Petrenko, Vadim" <va...@ns.nl> on 2021/03/09 09:49:05 UTC
Artemis divert from a queue to a topic
Dear Artemis developers,
I'd like to set up Artemis in such a way that all messages that get sent to a queue will be diverted to a topic, where I can have multiple (durable) subscribers.
(my_queue) --divert--> (my_topic)
I defined it like this:
<diverts>
<divert name="my_queue_to_my_topic">
<address>my_queue</address>
<forwarding-address>my_topic</forwarding-address>
<exclusive>false</exclusive>
</divert>
</diverts>
<addresses>
<address name="my_queue">
<anycast/>
</address>
<address name="my_topic">
<multicast/>
</address>
</addresses>
But it doesn't work. Messages don't end up in my_topic.
If I start sending messages directly to my_topic, then my subscribers receive them ok.
In the console I don't see any signs of messages in my_topic, they just seem disappear.
Could you give me a hint where to look at to make it work?
Thank you in advance!
PS. Why do I need this specific diverting? I connect this Artemis to another Artemis via a Qpid mesh, and I want a message sent to my_queue on the sending Artemis to be transferred to the receiving Artemis:
(Artemis 1:my_queue) --> (Qpid routers) --> (Artemis 2:my_queue)
On Artemis 2:
<broker-connections>
<amqp-connection uri="tcp://edge:5672" name="my-router">
<receiver address-match="my_queue"/>
</amqp-connection>
</broker-connections>
And this works with anycast addresses only (because of message routing in Qpid, which I need). My_queue naturally exists on the sending Artemis 1 too.
________________________________
Deze e-mail, inclusief eventuele bijlagen, is uitsluitend bestemd voor (gebruik door) de geadresseerde. De e-mail kan persoonlijke of vertrouwelijke informatie bevatten. Openbaarmaking, vermenigvuldiging, verspreiding en/of verstrekking van (de inhoud van) deze e-mail (en eventuele bijlagen) aan derden is uitdrukkelijk niet toegestaan. Indien u niet de bedoelde geadresseerde bent, wordt u vriendelijk verzocht degene die de e-mail verzond hiervan direct op de hoogte te brengen en de e-mail (en eventuele bijlagen) te vernietigen.
Informatie vennootschap<http://www.ns.nl/emaildisclaimer>
Re: Artemis divert from a queue to a topic
Posted by Justin Bertram <jb...@apache.org>.
FWIW, the example shipped with the broker in
examples/features/standard/divert demonstrates diverting messages from a
JMS queue to a JMS topic. Does this example work for you? If so, how does
it compare with your use-case which doesn't work?
Justin
On Tue, Mar 9, 2021 at 3:11 PM Justin Bertram <jb...@apache.org> wrote:
> The default routing-type for a divert is "STRIP" (which means it will
> remove any existing routing-type from the message during the process of
> diverting) so that shouldn't be an issue.
>
> Do you have a subscriber on my_topic when a message is sent to my_queue?
> What protocol are you using when sending the message?
>
>
> Justin
>
> On Tue, Mar 9, 2021 at 4:54 AM Gary Tully <ga...@gmail.com> wrote:
>
>> I *think* you may need to specify the routing type on the divert,
>> coming from a queue it may default to ANY_CAST.
>> use:
>>
>> <divert name="my_queue_to_my_topic">
>> <address>my_queue</address>
>> <forwarding-address>my_topic</forwarding-address>
>> <exclusive>false</exclusive>
>> <routing-type>MULTICAST</routing-type>
>> </divert>
>>
>> On Tue, 9 Mar 2021 at 09:49, Petrenko, Vadim <va...@ns.nl>
>> wrote:
>> >
>> > Dear Artemis developers,
>> >
>> > I'd like to set up Artemis in such a way that all messages that get
>> sent to a queue will be diverted to a topic, where I can have multiple
>> (durable) subscribers.
>> > (my_queue) --divert--> (my_topic)
>> >
>> > I defined it like this:
>> >
>> > <diverts>
>> > <divert name="my_queue_to_my_topic">
>> > <address>my_queue</address>
>> > <forwarding-address>my_topic</forwarding-address>
>> > <exclusive>false</exclusive>
>> > </divert>
>> > </diverts>
>> >
>> > <addresses>
>> > <address name="my_queue">
>> > <anycast/>
>> > </address>
>> > <address name="my_topic">
>> > <multicast/>
>> > </address>
>> > </addresses>
>> >
>> > But it doesn't work. Messages don't end up in my_topic.
>> > If I start sending messages directly to my_topic, then my subscribers
>> receive them ok.
>> > In the console I don't see any signs of messages in my_topic, they just
>> seem disappear.
>> >
>> > Could you give me a hint where to look at to make it work?
>> >
>> > Thank you in advance!
>> >
>> > PS. Why do I need this specific diverting? I connect this Artemis to
>> another Artemis via a Qpid mesh, and I want a message sent to my_queue on
>> the sending Artemis to be transferred to the receiving Artemis:
>> > (Artemis 1:my_queue) --> (Qpid routers) --> (Artemis 2:my_queue)
>> >
>> > On Artemis 2:
>> > <broker-connections>
>> > <amqp-connection uri="tcp://edge:5672" name="my-router">
>> > <receiver address-match="my_queue"/>
>> > </amqp-connection>
>> > </broker-connections>
>> >
>> > And this works with anycast addresses only (because of message routing
>> in Qpid, which I need). My_queue naturally exists on the sending Artemis 1
>> too.
>> >
>> >
>> > ________________________________
>> >
>> > Deze e-mail, inclusief eventuele bijlagen, is uitsluitend bestemd voor
>> (gebruik door) de geadresseerde. De e-mail kan persoonlijke of
>> vertrouwelijke informatie bevatten. Openbaarmaking, vermenigvuldiging,
>> verspreiding en/of verstrekking van (de inhoud van) deze e-mail (en
>> eventuele bijlagen) aan derden is uitdrukkelijk niet toegestaan. Indien u
>> niet de bedoelde geadresseerde bent, wordt u vriendelijk verzocht degene
>> die de e-mail verzond hiervan direct op de hoogte te brengen en de e-mail
>> (en eventuele bijlagen) te vernietigen.
>> >
>> > Informatie vennootschap<http://www.ns.nl/emaildisclaimer>
>>
>>
Re: Artemis divert from a queue to a topic
Posted by Justin Bertram <jb...@apache.org>.
The default routing-type for a divert is "STRIP" (which means it will
remove any existing routing-type from the message during the process of
diverting) so that shouldn't be an issue.
Do you have a subscriber on my_topic when a message is sent to my_queue?
What protocol are you using when sending the message?
Justin
On Tue, Mar 9, 2021 at 4:54 AM Gary Tully <ga...@gmail.com> wrote:
> I *think* you may need to specify the routing type on the divert,
> coming from a queue it may default to ANY_CAST.
> use:
>
> <divert name="my_queue_to_my_topic">
> <address>my_queue</address>
> <forwarding-address>my_topic</forwarding-address>
> <exclusive>false</exclusive>
> <routing-type>MULTICAST</routing-type>
> </divert>
>
> On Tue, 9 Mar 2021 at 09:49, Petrenko, Vadim <va...@ns.nl> wrote:
> >
> > Dear Artemis developers,
> >
> > I'd like to set up Artemis in such a way that all messages that get sent
> to a queue will be diverted to a topic, where I can have multiple (durable)
> subscribers.
> > (my_queue) --divert--> (my_topic)
> >
> > I defined it like this:
> >
> > <diverts>
> > <divert name="my_queue_to_my_topic">
> > <address>my_queue</address>
> > <forwarding-address>my_topic</forwarding-address>
> > <exclusive>false</exclusive>
> > </divert>
> > </diverts>
> >
> > <addresses>
> > <address name="my_queue">
> > <anycast/>
> > </address>
> > <address name="my_topic">
> > <multicast/>
> > </address>
> > </addresses>
> >
> > But it doesn't work. Messages don't end up in my_topic.
> > If I start sending messages directly to my_topic, then my subscribers
> receive them ok.
> > In the console I don't see any signs of messages in my_topic, they just
> seem disappear.
> >
> > Could you give me a hint where to look at to make it work?
> >
> > Thank you in advance!
> >
> > PS. Why do I need this specific diverting? I connect this Artemis to
> another Artemis via a Qpid mesh, and I want a message sent to my_queue on
> the sending Artemis to be transferred to the receiving Artemis:
> > (Artemis 1:my_queue) --> (Qpid routers) --> (Artemis 2:my_queue)
> >
> > On Artemis 2:
> > <broker-connections>
> > <amqp-connection uri="tcp://edge:5672" name="my-router">
> > <receiver address-match="my_queue"/>
> > </amqp-connection>
> > </broker-connections>
> >
> > And this works with anycast addresses only (because of message routing
> in Qpid, which I need). My_queue naturally exists on the sending Artemis 1
> too.
> >
> >
> > ________________________________
> >
> > Deze e-mail, inclusief eventuele bijlagen, is uitsluitend bestemd voor
> (gebruik door) de geadresseerde. De e-mail kan persoonlijke of
> vertrouwelijke informatie bevatten. Openbaarmaking, vermenigvuldiging,
> verspreiding en/of verstrekking van (de inhoud van) deze e-mail (en
> eventuele bijlagen) aan derden is uitdrukkelijk niet toegestaan. Indien u
> niet de bedoelde geadresseerde bent, wordt u vriendelijk verzocht degene
> die de e-mail verzond hiervan direct op de hoogte te brengen en de e-mail
> (en eventuele bijlagen) te vernietigen.
> >
> > Informatie vennootschap<http://www.ns.nl/emaildisclaimer>
>
>
Re: Artemis divert from a queue to a topic
Posted by Gary Tully <ga...@gmail.com>.
I *think* you may need to specify the routing type on the divert,
coming from a queue it may default to ANY_CAST.
use:
<divert name="my_queue_to_my_topic">
<address>my_queue</address>
<forwarding-address>my_topic</forwarding-address>
<exclusive>false</exclusive>
<routing-type>MULTICAST</routing-type>
</divert>
On Tue, 9 Mar 2021 at 09:49, Petrenko, Vadim <va...@ns.nl> wrote:
>
> Dear Artemis developers,
>
> I'd like to set up Artemis in such a way that all messages that get sent to a queue will be diverted to a topic, where I can have multiple (durable) subscribers.
> (my_queue) --divert--> (my_topic)
>
> I defined it like this:
>
> <diverts>
> <divert name="my_queue_to_my_topic">
> <address>my_queue</address>
> <forwarding-address>my_topic</forwarding-address>
> <exclusive>false</exclusive>
> </divert>
> </diverts>
>
> <addresses>
> <address name="my_queue">
> <anycast/>
> </address>
> <address name="my_topic">
> <multicast/>
> </address>
> </addresses>
>
> But it doesn't work. Messages don't end up in my_topic.
> If I start sending messages directly to my_topic, then my subscribers receive them ok.
> In the console I don't see any signs of messages in my_topic, they just seem disappear.
>
> Could you give me a hint where to look at to make it work?
>
> Thank you in advance!
>
> PS. Why do I need this specific diverting? I connect this Artemis to another Artemis via a Qpid mesh, and I want a message sent to my_queue on the sending Artemis to be transferred to the receiving Artemis:
> (Artemis 1:my_queue) --> (Qpid routers) --> (Artemis 2:my_queue)
>
> On Artemis 2:
> <broker-connections>
> <amqp-connection uri="tcp://edge:5672" name="my-router">
> <receiver address-match="my_queue"/>
> </amqp-connection>
> </broker-connections>
>
> And this works with anycast addresses only (because of message routing in Qpid, which I need). My_queue naturally exists on the sending Artemis 1 too.
>
>
> ________________________________
>
> Deze e-mail, inclusief eventuele bijlagen, is uitsluitend bestemd voor (gebruik door) de geadresseerde. De e-mail kan persoonlijke of vertrouwelijke informatie bevatten. Openbaarmaking, vermenigvuldiging, verspreiding en/of verstrekking van (de inhoud van) deze e-mail (en eventuele bijlagen) aan derden is uitdrukkelijk niet toegestaan. Indien u niet de bedoelde geadresseerde bent, wordt u vriendelijk verzocht degene die de e-mail verzond hiervan direct op de hoogte te brengen en de e-mail (en eventuele bijlagen) te vernietigen.
>
> Informatie vennootschap<http://www.ns.nl/emaildisclaimer>