You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Joe Drumm <jo...@gmail.com> on 2012/03/14 21:39:46 UTC

Setting RoutingKey, QPID 0.6

Hi,

We are new to QPID and using Apache QPID 0.6.  We are able to send
messages to a queue, but we need to set a 'routing key' and can't
figure out how to do this in 0.6.

We see in and older version of QPID that you are able to do:

       qpid::client::Message message;
       message.getDeliveryProperties().setRoutingKey(routingKey);

...but the API in 0.6 seems to have changed.

Does anyone have any info here?

Thanks in advance

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


Re: Setting RoutingKey, QPID 0.6

Posted by Virgilio Fornazin <vi...@gmail.com>.
A little snippet that may helps

            void qpid_connection::send(const destination & destination,
const message_interface & message_to_send, const bool durable)
            {
                context * qpid_context = reinterpret_cast<context
*>(m_qpid_context);

                qpid::messaging::Sender & =
qpid_context->get_sender(destination);

                try
                {
                    qpid::messaging::Message message(reinterpret_cast<const
char *>(message_to_send.ptr()), message_to_send.size());

                    if (destination.type() != destination_type::broadcast)
                    {
                        message.setSubject(destination.name());
                    }

                    message.setDurable(durable);

                    sender.send(message,
qpid_context->m_send_messages_sync);
                }
                catch (std::exception & e)
                {
                    throw
qpid_operation_exception(valor::core::runtime::string_format::format("Send
operation failed: %s", e.what()));
                }
            }

On Wed, Mar 14, 2012 at 17:39, Joe Drumm <jo...@gmail.com> wrote:

> Hi,
>
> We are new to QPID and using Apache QPID 0.6.  We are able to send
> messages to a queue, but we need to set a 'routing key' and can't
> figure out how to do this in 0.6.
>
> We see in and older version of QPID that you are able to do:
>
>       qpid::client::Message message;
>       message.getDeliveryProperties().setRoutingKey(routingKey);
>
> ...but the API in 0.6 seems to have changed.
>
> Does anyone have any info here?
>
> Thanks in advance
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>
>