You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by "Senthil Kumar, Sinduja (GE Healthcare)" <Si...@ge.com> on 2012/02/03 07:37:23 UTC

Receiving Messages from Multiple Sources

Hi,

Iam a newbie to QPID.

Can someone explain me how to set the addresses for Receiving Messages
from Multiple Sources.

 

For ex:,

 

C++:

Receiver receiver1 = session.createReceiver(address1);

receiver1.setCapacity(10);

Receiver receiver2 = session.createReceiver(address2);

receiver2.setCapacity(10);

Message message = session.nextReceiver().fetch();

std::cout << message.getContent() << std::endl;

session.acknowledge(); // acknowledge message receipt

 

what would be the nature of address1 and address2?

Can someone tell me how to set theses addresses.

 

Regards,

Sinduja.R

 

 


RE: Receiving Messages from Multiple Sources

Posted by "Senthil Kumar, Sinduja (GE Healthcare)" <Si...@ge.com>.
Hi,

I don't have the following qpid tools.How to get it. Moreover, I don find qpid-tools anywhere in my qpid directory structure,.

qpid-route
qpid-config
qpid-tool
qpid-printevents

Can anyone help me in installing all these tools.

Regards,
Sinduja.R

-----Original Message-----
From: tkdchen [mailto:qcxhome@gmail.com] 
Sent: Friday, February 03, 2012 8:23 PM
To: Senthil Kumar, Sinduja (GE Healthcare)
Cc: users@qpid.apache.org
Subject: Re: Receiving Messages from Multiple Sources

On Fri, Feb 3, 2012 at 6:18 PM, Senthil Kumar, Sinduja (GE Healthcare) <Si...@ge.com> wrote:
> Hi,
>
> When I try to add an exchange , I get this error. Can someone tell me 
> how to add an exchange etc # qpid-config add exchange topic 
> news-service If 'qpid-config' is not a typo you can use 
> command-not-found to lookup the package that contains it, like this:
>    cnf qpid-config
>

qpid-config is in package qpid-tools.

$ sudo yum install qpid-tools

>
> Regards,
> Sinduja.R
>
>
> -----Original Message-----
> From: tkdchen [mailto:qcxhome@gmail.com]
> Sent: Friday, February 03, 2012 12:53 PM
> To: users@qpid.apache.org
> Cc: Senthil Kumar, Sinduja (GE Healthcare)
> Subject: Re: Receiving Messages from Multiple Sources
>
> On Fri, Feb 3, 2012 at 2:37 PM, Senthil Kumar, Sinduja (GE Healthcare) 
> <Si...@ge.com> wrote:
>> Hi,
>>
>> Iam a newbie to QPID.
>>
>> Can someone explain me how to set the addresses for Receiving 
>> Messages
>
>> from Multiple Sources.
>>
>>
>
> You can use multiple binding keys to bind a queue to a topic exchange.
> So, the rest is to ref the documentation of C++ client API.
> I'm using Python, not familiar with C++ client API.
>
>>
>> For ex:,
>>
>>
>>
>> C++:
>>
>> Receiver receiver1 = session.createReceiver(address1);
>>
>> receiver1.setCapacity(10);
>>
>> Receiver receiver2 = session.createReceiver(address2);
>>
>> receiver2.setCapacity(10);
>>
>> Message message = session.nextReceiver().fetch();
>>
>> std::cout << message.getContent() << std::endl;
>>
>> session.acknowledge(); // acknowledge message receipt
>>
>>
>>
>> what would be the nature of address1 and address2?
>>
>> Can someone tell me how to set theses addresses.
>>
>>
>>
>> Regards,
>>
>> Sinduja.R
>>
>>
>>
>>
>>

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Receiving Messages from Multiple Sources

Posted by tkdchen <qc...@gmail.com>.
On Fri, Feb 3, 2012 at 6:18 PM, Senthil Kumar, Sinduja (GE Healthcare)
<Si...@ge.com> wrote:
> Hi,
>
> When I try to add an exchange , I get this error. Can someone tell me
> how to add an exchange
> etc # qpid-config add exchange topic news-service
> If 'qpid-config' is not a typo you can use command-not-found to lookup
> the package that contains it, like this:
>    cnf qpid-config
>

qpid-config is in package qpid-tools.

$ sudo yum install qpid-tools

>
> Regards,
> Sinduja.R
>
>
> -----Original Message-----
> From: tkdchen [mailto:qcxhome@gmail.com]
> Sent: Friday, February 03, 2012 12:53 PM
> To: users@qpid.apache.org
> Cc: Senthil Kumar, Sinduja (GE Healthcare)
> Subject: Re: Receiving Messages from Multiple Sources
>
> On Fri, Feb 3, 2012 at 2:37 PM, Senthil Kumar, Sinduja (GE Healthcare)
> <Si...@ge.com> wrote:
>> Hi,
>>
>> Iam a newbie to QPID.
>>
>> Can someone explain me how to set the addresses for Receiving Messages
>
>> from Multiple Sources.
>>
>>
>
> You can use multiple binding keys to bind a queue to a topic exchange.
> So, the rest is to ref the documentation of C++ client API.
> I'm using Python, not familiar with C++ client API.
>
>>
>> For ex:,
>>
>>
>>
>> C++:
>>
>> Receiver receiver1 = session.createReceiver(address1);
>>
>> receiver1.setCapacity(10);
>>
>> Receiver receiver2 = session.createReceiver(address2);
>>
>> receiver2.setCapacity(10);
>>
>> Message message = session.nextReceiver().fetch();
>>
>> std::cout << message.getContent() << std::endl;
>>
>> session.acknowledge(); // acknowledge message receipt
>>
>>
>>
>> what would be the nature of address1 and address2?
>>
>> Can someone tell me how to set theses addresses.
>>
>>
>>
>> Regards,
>>
>> Sinduja.R
>>
>>
>>
>>
>>

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


RE: Receiving Messages from Multiple Sources

Posted by "Senthil Kumar, Sinduja (GE Healthcare)" <Si...@ge.com>.
Hi,

When I try to add an exchange , I get this error. Can someone tell me
how to add an exchange
etc # qpid-config add exchange topic news-service
If 'qpid-config' is not a typo you can use command-not-found to lookup
the package that contains it, like this:
    cnf qpid-config


Regards,
Sinduja.R


-----Original Message-----
From: tkdchen [mailto:qcxhome@gmail.com] 
Sent: Friday, February 03, 2012 12:53 PM
To: users@qpid.apache.org
Cc: Senthil Kumar, Sinduja (GE Healthcare)
Subject: Re: Receiving Messages from Multiple Sources

On Fri, Feb 3, 2012 at 2:37 PM, Senthil Kumar, Sinduja (GE Healthcare)
<Si...@ge.com> wrote:
> Hi,
>
> Iam a newbie to QPID.
>
> Can someone explain me how to set the addresses for Receiving Messages

> from Multiple Sources.
>
>

You can use multiple binding keys to bind a queue to a topic exchange.
So, the rest is to ref the documentation of C++ client API.
I'm using Python, not familiar with C++ client API.

>
> For ex:,
>
>
>
> C++:
>
> Receiver receiver1 = session.createReceiver(address1);
>
> receiver1.setCapacity(10);
>
> Receiver receiver2 = session.createReceiver(address2);
>
> receiver2.setCapacity(10);
>
> Message message = session.nextReceiver().fetch();
>
> std::cout << message.getContent() << std::endl;
>
> session.acknowledge(); // acknowledge message receipt
>
>
>
> what would be the nature of address1 and address2?
>
> Can someone tell me how to set theses addresses.
>
>
>
> Regards,
>
> Sinduja.R
>
>
>
>
>

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Receiving Messages from Multiple Sources

Posted by William Henry <wh...@redhat.com>.

----- Original Message -----
> Thanks for the reply...
> 
> 					Server.cpp
> My address1 :
> Receiver receiver1 =
> session.createReceiver("service_queue/usa.news;{create:always}");
> My address2:
> Receiver receiver2 =
> session.createReceiver("service_queue/europe.news;{create:always}");
> 
> 					Client1.cpp
> Sender sender = session.createSender("service_queue/europe.*");
> 					Client2.cpp
> Sender sender = session.createSender("service_queue/usa.*");

Don't use the wild card in the address for the sender. You should be just sending to "node" address, which is the queue name in this case. (I know I'm sorry this is confusing)

It's in the message that you set the topic for the message (the routing key). The broker will make sure that that message will arrive on the correct, subscribed, queue/receiver.

Have a look here. This might help:
https://cwiki.apache.org/confluence/display/qpid/Addressing+Examples


William

> 
> Is this the way of setting two different addresses? Please help.
> Kindly tell me how to set two different addresses in this particular
> scenario.
> 
> Regards,
> Sinduja.R
> 
> 
> 
> 
> -----Original Message-----
> From: tkdchen [mailto:qcxhome@gmail.com]
> Sent: Friday, February 03, 2012 12:53 PM
> To: users@qpid.apache.org
> Cc: Senthil Kumar, Sinduja (GE Healthcare)
> Subject: Re: Receiving Messages from Multiple Sources
> 
> On Fri, Feb 3, 2012 at 2:37 PM, Senthil Kumar, Sinduja (GE
> Healthcare)
> <Si...@ge.com> wrote:
> > Hi,
> >
> > Iam a newbie to QPID.
> >
> > Can someone explain me how to set the addresses for Receiving
> > Messages
> 
> > from Multiple Sources.
> >
> >
> 
> You can use multiple binding keys to bind a queue to a topic
> exchange.
> So, the rest is to ref the documentation of C++ client API.
> I'm using Python, not familiar with C++ client API.
> 
> >
> > For ex:,
> >
> >
> >
> > C++:
> >
> > Receiver receiver1 = session.createReceiver(address1);
> >
> > receiver1.setCapacity(10);
> >
> > Receiver receiver2 = session.createReceiver(address2);
> >
> > receiver2.setCapacity(10);
> >
> > Message message = session.nextReceiver().fetch();
> >
> > std::cout << message.getContent() << std::endl;
> >
> > session.acknowledge(); // acknowledge message receipt
> >
> >
> >
> > what would be the nature of address1 and address2?
> >
> > Can someone tell me how to set theses addresses.
> >
> >
> >
> > Regards,
> >
> > Sinduja.R
> >
> >
> >
> >
> >
> 
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
> 
> 

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


RE: Receiving Messages from Multiple Sources

Posted by "Senthil Kumar, Sinduja (GE Healthcare)" <Si...@ge.com>.
Thanks for the reply...

					Server.cpp
My address1 :
Receiver receiver1 =
session.createReceiver("service_queue/usa.news;{create:always}");
My address2:
Receiver receiver2 =
session.createReceiver("service_queue/europe.news;{create:always}");

					Client1.cpp
Sender sender = session.createSender("service_queue/europe.*");
					Client2.cpp
Sender sender = session.createSender("service_queue/usa.*");

Is this the way of setting two different addresses? Please help.
Kindly tell me how to set two different addresses in this particular
scenario.

Regards,
Sinduja.R




-----Original Message-----
From: tkdchen [mailto:qcxhome@gmail.com] 
Sent: Friday, February 03, 2012 12:53 PM
To: users@qpid.apache.org
Cc: Senthil Kumar, Sinduja (GE Healthcare)
Subject: Re: Receiving Messages from Multiple Sources

On Fri, Feb 3, 2012 at 2:37 PM, Senthil Kumar, Sinduja (GE Healthcare)
<Si...@ge.com> wrote:
> Hi,
>
> Iam a newbie to QPID.
>
> Can someone explain me how to set the addresses for Receiving Messages

> from Multiple Sources.
>
>

You can use multiple binding keys to bind a queue to a topic exchange.
So, the rest is to ref the documentation of C++ client API.
I'm using Python, not familiar with C++ client API.

>
> For ex:,
>
>
>
> C++:
>
> Receiver receiver1 = session.createReceiver(address1);
>
> receiver1.setCapacity(10);
>
> Receiver receiver2 = session.createReceiver(address2);
>
> receiver2.setCapacity(10);
>
> Message message = session.nextReceiver().fetch();
>
> std::cout << message.getContent() << std::endl;
>
> session.acknowledge(); // acknowledge message receipt
>
>
>
> what would be the nature of address1 and address2?
>
> Can someone tell me how to set theses addresses.
>
>
>
> Regards,
>
> Sinduja.R
>
>
>
>
>

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Receiving Messages from Multiple Sources

Posted by tkdchen <qc...@gmail.com>.
On Fri, Feb 3, 2012 at 2:37 PM, Senthil Kumar, Sinduja (GE Healthcare)
<Si...@ge.com> wrote:
> Hi,
>
> Iam a newbie to QPID.
>
> Can someone explain me how to set the addresses for Receiving Messages
> from Multiple Sources.
>
>

You can use multiple binding keys to bind a queue to a topic exchange.
So, the rest is to ref the documentation of C++ client API.
I'm using Python, not familiar with C++ client API.

>
> For ex:,
>
>
>
> C++:
>
> Receiver receiver1 = session.createReceiver(address1);
>
> receiver1.setCapacity(10);
>
> Receiver receiver2 = session.createReceiver(address2);
>
> receiver2.setCapacity(10);
>
> Message message = session.nextReceiver().fetch();
>
> std::cout << message.getContent() << std::endl;
>
> session.acknowledge(); // acknowledge message receipt
>
>
>
> what would be the nature of address1 and address2?
>
> Can someone tell me how to set theses addresses.
>
>
>
> Regards,
>
> Sinduja.R
>
>
>
>
>

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org