You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Adel Boutros <ad...@live.com> on 2016/07/28 14:17:55 UTC

[Qpid dispatch router] Do we need a broker to send/receive messages?

Hello,

Out of curiosity, Can I send/receive messages with a queue defined directly on the dispatch router or do I need to have a real instance of a broker connected to that dispatcher?

I am asking because it seems that the dispatch router has by default some "Addresses" used for internal communication and I was wondering if I could create an "address" of a type queue and use it directly without adding connectors.

Router Addresses
  class   addr                   phs  distrib  in-proc  local  remote  cntnr  in  out  thru  to-proc  from-proc
  ===============================================================================================================
  local   $_management_internal       closest  1        0      0       0      0   0    0     0        0
  local   $displayname                closest  1        0      0       0      0   0    0     0        0
  mobile  $management            0    closest  1        0      0       0      3   0    0     3        0
  local   $management                 closest  1        0      0       0      0   0    0     0        0
  local   temp.9yqNIIHanFkSZbe        closest  0        1      0       0      0   0    0     0        0


Regards,
Adel
 		 	   		  

RE: [Qpid dispatch router] Do we need a broker to send/receive messages?

Posted by Paolo Patierno <pp...@live.com>.
Hi Adel, 

the router doesn't support the "store and forward" mechanism itself so you need to connect a broker in order to store messages.

The addresses you see are all related to the management endpoint for example or reply address for the requests which comes from tools (like qdstat, qdmanage, ...). Some other addresses are used for routers communication. No one of this "support" something like a storing feature, it's just an address related to an AMQP node.

By the way, you asked if "Do we need a broker to send/receive messages?". It's true only if you want store feature. Otherwise you can have a receiver and a sender exchanging messages directly through the router. It means that if receiver is offline and not connected to the router, the sender doesn't receive credits in order to send messages until the receiver will be online on the same address (so as I said messages can't be stored waiting for a receiver coming online).

Thanks,
Paolo

Paolo PatiernoSenior Software Engineer (IoT) @ Red Hat
Microsoft MVP on Windows Embedded & IoTMicrosoft Azure Advisor 
Twitter : @ppatierno
Linkedin : paolopatierno
Blog : DevExperience

> From: adelboutros@live.com
> To: users@qpid.apache.org
> Subject: [Qpid dispatch router] Do we need a broker to send/receive messages?
> Date: Thu, 28 Jul 2016 16:17:55 +0200
> 
> Hello,
> 
> Out of curiosity, Can I send/receive messages with a queue defined directly on the dispatch router or do I need to have a real instance of a broker connected to that dispatcher?
> 
> I am asking because it seems that the dispatch router has by default some "Addresses" used for internal communication and I was wondering if I could create an "address" of a type queue and use it directly without adding connectors.
> 
> Router Addresses
>   class   addr                   phs  distrib  in-proc  local  remote  cntnr  in  out  thru  to-proc  from-proc
>   ===============================================================================================================
>   local   $_management_internal       closest  1        0      0       0      0   0    0     0        0
>   local   $displayname                closest  1        0      0       0      0   0    0     0        0
>   mobile  $management            0    closest  1        0      0       0      3   0    0     3        0
>   local   $management                 closest  1        0      0       0      0   0    0     0        0
>   local   temp.9yqNIIHanFkSZbe        closest  0        1      0       0      0   0    0     0        0
> 
> 
> Regards,
> Adel
>  		 	   		  
 		 	   		  

RE: [Qpid dispatch router] Do we need a broker to send/receive messages?

Posted by Adel Boutros <ad...@live.com>.


The process was actually hanging on the send call.
JMS CodeJmsConnectionFactory jmsConnectionFactory = new JmsConnectionFactory("amqp://MACHINE_NAME:10254");Connection connection = jmsConnectionFactory.createConnection();try {    Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);    Queue perfQueue = session.createQueue("perf.topic");    Topic topic = session.createTopic("perf.topic");    MessageProducer producer = session.createProducer(topic);    MessageConsumer consumer = session.createConsumer(perfQueue);    connection.start();    producer.send(session.createTextMessage("Hello"));    Message receive = consumer.receive(3000);    assertThat(((TextMessage) receive).getText()).isEqualTo("Hello");} finally {    connection.close();}Dispatcher configrouter {    id: router.10254    mode: interior    worker-threads: 8}address {   prefix: perf.topic
   waypoint: false
   distribution: balanced
}listener {    host: 0.0.0.0    port: 10254    role: standalone    saslMechanisms: ANONYMOUS    requireSsl: no    authenticatePeer: no}Adel
> Subject: Re: [Qpid dispatch router] Do we need a broker to send/receive messages?
> To: users@qpid.apache.org
> From: tross@redhat.com
> Date: Tue, 2 Aug 2016 09:05:44 -0400
> 
> 
> On 08/02/2016 05:02 AM, Adel Boutros wrote:
> > Hello again,
> >
> > If the address is configured with "balanced", I am unable to exchange messages. When using "multicast" it worked.
> > Is this expected?
> 
> No, both distributions work, albeit with different behavior when there 
> are multiple consumers.
> 
> When you have direct consumers attached to the router, the address 
> appears in the list from "qdstat -a".  What does your setup look like?
> 
> -Ted
> 
> >
> > Regards,
> > Adel
> >
> >> From: adelboutros@live.com
> >> To: users@qpid.apache.org
> >> Subject: RE: [Qpid dispatch router] Do we need a broker to send/receive messages?
> >> Date: Thu, 28 Jul 2016 16:51:50 +0200
> >>
> >> Thank you Ted and Paolo,
> >> Actually I tried to have only a publisher connected and it was hanging. Now I understand why: It is because I need a consumer connected to get credits.
> >> Regards,Adel
> >>
> >>> Subject: Re: [Qpid dispatch router] Do we need a broker to send/receive messages?
> >>> To: users@qpid.apache.org
> >>> From: tross@redhat.com
> >>> Date: Thu, 28 Jul 2016 10:47:43 -0400
> >>>
> >>>
> >>> On 07/28/2016 10:17 AM, Adel Boutros wrote:
> >>>> Hello,
> >>>>
> >>>> Out of curiosity, Can I send/receive messages with a queue defined directly on the dispatch router or do I need to have a real instance of a broker connected to that dispatcher?
> >>>
> >>> Like Paolo said, you only need a broker if you want to store the message
> >>> in a queue.
> >>>
> >>> You can use the router(s) to communicate directly by having the senders
> >>> and receivers use the same address.  In this case, the exchange of
> >>> messages (acknowledgement, settlement, etc.) are routed directly between
> >>> the senders and the receivers.
> >>>
> >>> To do this, you don't need a route-container connection and you don't
> >>> need auto-links or link-routes.  You only need to configure the address
> >>> prefix to control whether the deliveries are multicast (all receivers
> >>> for the address) or anycast (one receiver for the address).  Addresses
> >>> that don't match any configured prefix default to balanced-anycast.
> >>>
> >>> You can use a hybrid approach as well, with some addresses defined as
> >>> "waypoint" with autolinks and other addresses that are not "waypoint"
> >>> that are used for direct producer-to-consumer communication.
> >>>
> >>>>
> >>>> I am asking because it seems that the dispatch router has by default some "Addresses" used for internal communication and I was wondering if I could create an "address" of a type queue and use it directly without adding connectors.
> >>>>
> >>>> Router Addresses
> >>>>   class   addr                   phs  distrib  in-proc  local  remote  cntnr  in  out  thru  to-proc  from-proc
> >>>>   ===============================================================================================================
> >>>>   local   $_management_internal       closest  1        0      0       0      0   0    0     0        0
> >>>>   local   $displayname                closest  1        0      0       0      0   0    0     0        0
> >>>>   mobile  $management            0    closest  1        0      0       0      3   0    0     3        0
> >>>>   local   $management                 closest  1        0      0       0      0   0    0     0        0
> >>>>   local   temp.9yqNIIHanFkSZbe        closest  0        1      0       0      0   0    0     0        0
> >>>>
> >>>>
> >>>> Regards,
> >>>> Adel
> >>>>  		 	   		
> >>>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> >>> For additional commands, e-mail: users-help@qpid.apache.org
> >>>
> >>  		 	   		
> >  		 	   		
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
> 

 		 	   		  

Re: [Qpid dispatch router] Do we need a broker to send/receive messages?

Posted by Ted Ross <tr...@redhat.com>.
On 08/02/2016 05:02 AM, Adel Boutros wrote:
> Hello again,
>
> If the address is configured with "balanced", I am unable to exchange messages. When using "multicast" it worked.
> Is this expected?

No, both distributions work, albeit with different behavior when there 
are multiple consumers.

When you have direct consumers attached to the router, the address 
appears in the list from "qdstat -a".  What does your setup look like?

-Ted

>
> Regards,
> Adel
>
>> From: adelboutros@live.com
>> To: users@qpid.apache.org
>> Subject: RE: [Qpid dispatch router] Do we need a broker to send/receive messages?
>> Date: Thu, 28 Jul 2016 16:51:50 +0200
>>
>> Thank you Ted and Paolo,
>> Actually I tried to have only a publisher connected and it was hanging. Now I understand why: It is because I need a consumer connected to get credits.
>> Regards,Adel
>>
>>> Subject: Re: [Qpid dispatch router] Do we need a broker to send/receive messages?
>>> To: users@qpid.apache.org
>>> From: tross@redhat.com
>>> Date: Thu, 28 Jul 2016 10:47:43 -0400
>>>
>>>
>>> On 07/28/2016 10:17 AM, Adel Boutros wrote:
>>>> Hello,
>>>>
>>>> Out of curiosity, Can I send/receive messages with a queue defined directly on the dispatch router or do I need to have a real instance of a broker connected to that dispatcher?
>>>
>>> Like Paolo said, you only need a broker if you want to store the message
>>> in a queue.
>>>
>>> You can use the router(s) to communicate directly by having the senders
>>> and receivers use the same address.  In this case, the exchange of
>>> messages (acknowledgement, settlement, etc.) are routed directly between
>>> the senders and the receivers.
>>>
>>> To do this, you don't need a route-container connection and you don't
>>> need auto-links or link-routes.  You only need to configure the address
>>> prefix to control whether the deliveries are multicast (all receivers
>>> for the address) or anycast (one receiver for the address).  Addresses
>>> that don't match any configured prefix default to balanced-anycast.
>>>
>>> You can use a hybrid approach as well, with some addresses defined as
>>> "waypoint" with autolinks and other addresses that are not "waypoint"
>>> that are used for direct producer-to-consumer communication.
>>>
>>>>
>>>> I am asking because it seems that the dispatch router has by default some "Addresses" used for internal communication and I was wondering if I could create an "address" of a type queue and use it directly without adding connectors.
>>>>
>>>> Router Addresses
>>>>   class   addr                   phs  distrib  in-proc  local  remote  cntnr  in  out  thru  to-proc  from-proc
>>>>   ===============================================================================================================
>>>>   local   $_management_internal       closest  1        0      0       0      0   0    0     0        0
>>>>   local   $displayname                closest  1        0      0       0      0   0    0     0        0
>>>>   mobile  $management            0    closest  1        0      0       0      3   0    0     3        0
>>>>   local   $management                 closest  1        0      0       0      0   0    0     0        0
>>>>   local   temp.9yqNIIHanFkSZbe        closest  0        1      0       0      0   0    0     0        0
>>>>
>>>>
>>>> Regards,
>>>> Adel
>>>>  		 	   		
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
>>> For additional commands, e-mail: users-help@qpid.apache.org
>>>
>>  		 	   		
>  		 	   		
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


RE: [Qpid dispatch router] Do we need a broker to send/receive messages?

Posted by Adel Boutros <ad...@live.com>.
Hello again,

If the address is configured with "balanced", I am unable to exchange messages. When using "multicast" it worked.
Is this expected?

Regards,
Adel

> From: adelboutros@live.com
> To: users@qpid.apache.org
> Subject: RE: [Qpid dispatch router] Do we need a broker to send/receive messages?
> Date: Thu, 28 Jul 2016 16:51:50 +0200
> 
> Thank you Ted and Paolo,
> Actually I tried to have only a publisher connected and it was hanging. Now I understand why: It is because I need a consumer connected to get credits.
> Regards,Adel
> 
> > Subject: Re: [Qpid dispatch router] Do we need a broker to send/receive messages?
> > To: users@qpid.apache.org
> > From: tross@redhat.com
> > Date: Thu, 28 Jul 2016 10:47:43 -0400
> > 
> > 
> > On 07/28/2016 10:17 AM, Adel Boutros wrote:
> > > Hello,
> > >
> > > Out of curiosity, Can I send/receive messages with a queue defined directly on the dispatch router or do I need to have a real instance of a broker connected to that dispatcher?
> > 
> > Like Paolo said, you only need a broker if you want to store the message 
> > in a queue.
> > 
> > You can use the router(s) to communicate directly by having the senders 
> > and receivers use the same address.  In this case, the exchange of 
> > messages (acknowledgement, settlement, etc.) are routed directly between 
> > the senders and the receivers.
> > 
> > To do this, you don't need a route-container connection and you don't 
> > need auto-links or link-routes.  You only need to configure the address 
> > prefix to control whether the deliveries are multicast (all receivers 
> > for the address) or anycast (one receiver for the address).  Addresses 
> > that don't match any configured prefix default to balanced-anycast.
> > 
> > You can use a hybrid approach as well, with some addresses defined as 
> > "waypoint" with autolinks and other addresses that are not "waypoint" 
> > that are used for direct producer-to-consumer communication.
> > 
> > >
> > > I am asking because it seems that the dispatch router has by default some "Addresses" used for internal communication and I was wondering if I could create an "address" of a type queue and use it directly without adding connectors.
> > >
> > > Router Addresses
> > >   class   addr                   phs  distrib  in-proc  local  remote  cntnr  in  out  thru  to-proc  from-proc
> > >   ===============================================================================================================
> > >   local   $_management_internal       closest  1        0      0       0      0   0    0     0        0
> > >   local   $displayname                closest  1        0      0       0      0   0    0     0        0
> > >   mobile  $management            0    closest  1        0      0       0      3   0    0     3        0
> > >   local   $management                 closest  1        0      0       0      0   0    0     0        0
> > >   local   temp.9yqNIIHanFkSZbe        closest  0        1      0       0      0   0    0     0        0
> > >
> > >
> > > Regards,
> > > Adel
> > >  		 	   		
> > >
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> > For additional commands, e-mail: users-help@qpid.apache.org
> > 
>  		 	   		  
 		 	   		  

RE: [Qpid dispatch router] Do we need a broker to send/receive messages?

Posted by Adel Boutros <ad...@live.com>.
Thank you Ted and Paolo,
Actually I tried to have only a publisher connected and it was hanging. Now I understand why: It is because I need a consumer connected to get credits.
Regards,Adel

> Subject: Re: [Qpid dispatch router] Do we need a broker to send/receive messages?
> To: users@qpid.apache.org
> From: tross@redhat.com
> Date: Thu, 28 Jul 2016 10:47:43 -0400
> 
> 
> On 07/28/2016 10:17 AM, Adel Boutros wrote:
> > Hello,
> >
> > Out of curiosity, Can I send/receive messages with a queue defined directly on the dispatch router or do I need to have a real instance of a broker connected to that dispatcher?
> 
> Like Paolo said, you only need a broker if you want to store the message 
> in a queue.
> 
> You can use the router(s) to communicate directly by having the senders 
> and receivers use the same address.  In this case, the exchange of 
> messages (acknowledgement, settlement, etc.) are routed directly between 
> the senders and the receivers.
> 
> To do this, you don't need a route-container connection and you don't 
> need auto-links or link-routes.  You only need to configure the address 
> prefix to control whether the deliveries are multicast (all receivers 
> for the address) or anycast (one receiver for the address).  Addresses 
> that don't match any configured prefix default to balanced-anycast.
> 
> You can use a hybrid approach as well, with some addresses defined as 
> "waypoint" with autolinks and other addresses that are not "waypoint" 
> that are used for direct producer-to-consumer communication.
> 
> >
> > I am asking because it seems that the dispatch router has by default some "Addresses" used for internal communication and I was wondering if I could create an "address" of a type queue and use it directly without adding connectors.
> >
> > Router Addresses
> >   class   addr                   phs  distrib  in-proc  local  remote  cntnr  in  out  thru  to-proc  from-proc
> >   ===============================================================================================================
> >   local   $_management_internal       closest  1        0      0       0      0   0    0     0        0
> >   local   $displayname                closest  1        0      0       0      0   0    0     0        0
> >   mobile  $management            0    closest  1        0      0       0      3   0    0     3        0
> >   local   $management                 closest  1        0      0       0      0   0    0     0        0
> >   local   temp.9yqNIIHanFkSZbe        closest  0        1      0       0      0   0    0     0        0
> >
> >
> > Regards,
> > Adel
> >  		 	   		
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
> 
 		 	   		  

Re: [Qpid dispatch router] Do we need a broker to send/receive messages?

Posted by Ted Ross <tr...@redhat.com>.
On 07/28/2016 10:17 AM, Adel Boutros wrote:
> Hello,
>
> Out of curiosity, Can I send/receive messages with a queue defined directly on the dispatch router or do I need to have a real instance of a broker connected to that dispatcher?

Like Paolo said, you only need a broker if you want to store the message 
in a queue.

You can use the router(s) to communicate directly by having the senders 
and receivers use the same address.  In this case, the exchange of 
messages (acknowledgement, settlement, etc.) are routed directly between 
the senders and the receivers.

To do this, you don't need a route-container connection and you don't 
need auto-links or link-routes.  You only need to configure the address 
prefix to control whether the deliveries are multicast (all receivers 
for the address) or anycast (one receiver for the address).  Addresses 
that don't match any configured prefix default to balanced-anycast.

You can use a hybrid approach as well, with some addresses defined as 
"waypoint" with autolinks and other addresses that are not "waypoint" 
that are used for direct producer-to-consumer communication.

>
> I am asking because it seems that the dispatch router has by default some "Addresses" used for internal communication and I was wondering if I could create an "address" of a type queue and use it directly without adding connectors.
>
> Router Addresses
>   class   addr                   phs  distrib  in-proc  local  remote  cntnr  in  out  thru  to-proc  from-proc
>   ===============================================================================================================
>   local   $_management_internal       closest  1        0      0       0      0   0    0     0        0
>   local   $displayname                closest  1        0      0       0      0   0    0     0        0
>   mobile  $management            0    closest  1        0      0       0      3   0    0     3        0
>   local   $management                 closest  1        0      0       0      0   0    0     0        0
>   local   temp.9yqNIIHanFkSZbe        closest  0        1      0       0      0   0    0     0        0
>
>
> Regards,
> Adel
>  		 	   		
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org