You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Rajesh Khan <ra...@gmail.com> on 2013/10/03 06:16:48 UTC

Re: Create a collection of topics

Sure here is how I create multiple topics

    Void CreateDynamicTopic(int con)
    {
    std::string queue_name = std::string("amq.topic/")  + "Symbol_Topic_" +
boost::lexical_cast<std::string>(con);
    std::string sender_string =  queue_name +";{node:{type:topic}}";
    connection = qpid::messaging::Connection("127.0.0.1");
    connection.open();
    connection.setOption("tcp-nodelay", true);
    Session session  = connection.createSession();
    sender = session.createSender(sender_string) ;
    sender.setCapacity(sender_capacity);
    }


    for(int i=0 ; i<900;i++)
    {
      CreateDynamicQueue(i)
    }

I wanted to know if there could be a faster way that I could just pass a
whole list to Qpid and it creates topics from that list



On Thu, Sep 12, 2013 at 11:21 PM, NimbusParc <ni...@yahoo.in> wrote:

> -------------Gordon Sim wrote-----------------
> >[Both the c++ and java brokers are still heavily based on the old pre
> >-1.0 AMQP model of queues, exchanges and bindings which didn't have an
> >explicit concept of 'topic'. The common usage though is to have an
> >exchange for a topic, with the type chosen by the need for subscribers
> >to filter on particular subtopics or to dynamically create distinct
> topics].
>
> +1
>
>
>
> --
> View this message in context:
> http://qpid.2158936.n2.nabble.com/Create-a-collection-of-topics-tp7597987p7598154.html
> Sent from the Apache Qpid users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>
>

Re: Create a collection of topics

Posted by NimbusParc <ni...@yahoo.in>.
+1
yes, its just creating senders for the amq.topic . 
As Gordon Sim said, it's good to create one sender to amq.topic and set the
subject to each message.


Gordon Sim wrote
> It's not actually 'creating' topics, it is just creating senders for the 
> amq.topic topic, each with a specific default subject.
> 
> So you could just create one sender to amq.topic, and then set the 
> subject of each message you send out.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: 

> users-unsubscribe@.apache

> For additional commands, e-mail: 

> users-help@.apache





--
View this message in context: http://qpid.2158936.n2.nabble.com/Create-a-collection-of-topics-tp7597987p7598961.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

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


Re: Create a collection of topics

Posted by Gordon Sim <gs...@redhat.com>.
On 10/03/2013 05:16 AM, Rajesh Khan wrote:
> Sure here is how I create multiple topics
>
>      Void CreateDynamicTopic(int con)
>      {
>      std::string queue_name = std::string("amq.topic/")  + "Symbol_Topic_" +
> boost::lexical_cast<std::string>(con);
>      std::string sender_string =  queue_name +";{node:{type:topic}}";
>      connection = qpid::messaging::Connection("127.0.0.1");
>      connection.open();
>      connection.setOption("tcp-nodelay", true);
>      Session session  = connection.createSession();
>      sender = session.createSender(sender_string) ;
>      sender.setCapacity(sender_capacity);
>      }
>
>
>      for(int i=0 ; i<900;i++)
>      {
>        CreateDynamicQueue(i)
>      }
>
> I wanted to know if there could be a faster way that I could just pass a
> whole list to Qpid and it creates topics from that list

It's not actually 'creating' topics, it is just creating senders for the 
amq.topic topic, each with a specific default subject.

So you could just create one sender to amq.topic, and then set the 
subject of each message you send out.

Not sure if that answers the wider question or not, however(?).


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