You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Jose Alberto Fernandez Parejo <ja...@indra.es> on 2019/04/24 07:38:11 UTC

qpid-cpp and virtual host

Hello everyone,


We are using rabbitmq broker and qpid-cpp-1.38.0 API to send/receive
messages to/from broker.

Our rabbitmq broker provider has defined a Virtual host at which queues
and exchange are created.

We have seen that virtualhost can be setting by field "vhost:/" in
hostname. But we have made several test and it was not possible to set
the virtualhost.

How can we address a virtualhost using qpid-cpp-1.38.0 API?
An example will be appreciated.

Note that we are using AMQP1.0.

Thanks in adavance
Regards

________________________________

Este correo electrónico y, en su caso, cualquier fichero anexo al mismo, contiene información de carácter confidencial exclusivamente dirigida a su destinatario o destinatarios. Si no es vd. el destinatario indicado, queda notificado que la lectura, utilización, divulgación y/o copia sin autorización está prohibida en virtud de la legislación vigente. En el caso de haber recibido este correo electrónico por error, se ruega notificar inmediatamente esta circunstancia mediante reenvío a la dirección electrónica del remitente.
Evite imprimir este mensaje si no es estrictamente necesario.

This email and any file attached to it (when applicable) contain(s) confidential information that is exclusively addressed to its recipient(s). If you are not the indicated recipient, you are informed that reading, using, disseminating and/or copying it without authorisation is forbidden in accordance with the legislation in effect. If you have received this email by mistake, please immediately notify the sender of the situation by resending it to their email address.
Avoid printing this message if it is not absolutely necessary.

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


Re: qpid-cpp and virtual host

Posted by Jose Alberto Fernandez Parejo <ja...@indra.es>.
Working properly now.

Thank you so much.



On 04/25/2019 08:46 AM, Gordon Sim wrote:
 > On 25/04/2019 9:15 am, Jose Alberto Fernandez Parejo wrote:
 >> It is strange but there is no host field in 'open' frame. See below the
 >> logs for the following calls:
 >>
 >>    Connection connection(url, "{protocol:amqp1.0}");
 >
 > Try:
 >
 > Connection connection(url, "{protocol:amqp1.0,virtualhost:'vhost:foo'}");
 >
 >>      connection.setOption("sasl-mechanism", "PLAIN");
 >>      connection.setOption("username", "p_21");
 >>      connection.setOption("password", "p_21");
 >>      connection.setOption("virtualhost", "P_21_seqdep");
 >>
 >>     connection.open();
 >>
 >> We have been debugging and it seems that
 >> ConnectionContext::configureConnection is not called after
 >> connection.setOption
 >
 > Yes, it is called on constructing the object, rather than on
initiating the open, which means the option has to be passed in to the
constructor. (That is less than ideal, I agree).
 >
 > ---------------------------------------------------------------------
 > To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
 > For additional commands, e-mail: users-help@qpid.apache.org
 >
 > .
 >


________________________________

Este correo electrónico y, en su caso, cualquier fichero anexo al mismo, contiene información de carácter confidencial exclusivamente dirigida a su destinatario o destinatarios. Si no es vd. el destinatario indicado, queda notificado que la lectura, utilización, divulgación y/o copia sin autorización está prohibida en virtud de la legislación vigente. En el caso de haber recibido este correo electrónico por error, se ruega notificar inmediatamente esta circunstancia mediante reenvío a la dirección electrónica del remitente.
Evite imprimir este mensaje si no es estrictamente necesario.

This email and any file attached to it (when applicable) contain(s) confidential information that is exclusively addressed to its recipient(s). If you are not the indicated recipient, you are informed that reading, using, disseminating and/or copying it without authorisation is forbidden in accordance with the legislation in effect. If you have received this email by mistake, please immediately notify the sender of the situation by resending it to their email address.
Avoid printing this message if it is not absolutely necessary.

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


Re: qpid-cpp and virtual host

Posted by Gordon Sim <gs...@redhat.com>.
On 25/04/2019 9:15 am, Jose Alberto Fernandez Parejo wrote:
> It is strange but there is no host field in 'open' frame. See below the
> logs for the following calls:
> 
>    Connection connection(url, "{protocol:amqp1.0}");

Try:

Connection connection(url, "{protocol:amqp1.0,virtualhost:'vhost:foo'}");

>      connection.setOption("sasl-mechanism", "PLAIN");
>      connection.setOption("username", "p_21");
>      connection.setOption("password", "p_21");
>      connection.setOption("virtualhost", "P_21_seqdep");
> 
>     connection.open();
> 
> We have been debugging and it seems that
> ConnectionContext::configureConnection is not called after
> connection.setOption

Yes, it is called on constructing the object, rather than on initiating 
the open, which means the option has to be passed in to the constructor. 
(That is less than ideal, I agree).

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


Re: qpid-cpp and virtual host

Posted by Jose Alberto Fernandez Parejo <ja...@indra.es>.

On 04/25/2019 06:47 AM, Gordon Sim wrote:
 > On 25/04/2019 7:16 am, Jose Alberto Fernandez Parejo wrote:
 >> Hello Gordon,
 >>
 >> Thank you very much for the quick response.
 >>
 >> We have downloaded the new version including that commit. Now there is
 >> no error when calling
 >>
 >> connection.setOption("virtualhost", "virtualhost_name");
 >>
 >> But the client is connecting to default virtual host "/" and not to the
 >> one set with setOption procedure.
 >>
 >> We are using rabbitmq broker. The logs of rabbitmq there is nothing
 >> regarding virtualhost when connecting.
 >>
 >> Is there anything we can check to be sure we are not doing anything
wrong?
 >
 > Run with QPID_LOG_ENABLE=trace+ while connecting and check that the
'open' frame's host field is set correctly.
 >
 > ---------------------------------------------------------------------
 > To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
 > For additional commands, e-mail: users-help@qpid.apache.org
 >
 > .
 >

Thanks for the response.

It is strange but there is no host field in 'open' frame. See below the
logs for the following calls:

   Connection connection(url, "{protocol:amqp1.0}");

     connection.setOption("sasl-mechanism", "PLAIN");
     connection.setOption("username", "p_21");
     connection.setOption("password", "p_21");
     connection.setOption("virtualhost", "P_21_seqdep");

    connection.open();

We have been debugging and it seems that
ConnectionContext::configureConnection is not called after
connection.setOption

Thanks again for your support.


Traces:

2019-04-25 08:54:47 [Messaging] debug Protocol defaults: amqp1.0,amqp0-10
2019-04-25 08:54:47 [Messaging] debug Trying versions amqp1.0
2019-04-25 08:54:47 [Messaging] debug Driver started
2019-04-25 08:54:47 [Messaging] info Starting connection to
amqp:tcp:127.0.0.1:5672
2019-04-25 08:54:47 [Messaging] info Connecting to tcp:127.0.0.1:5672
2019-04-25 08:54:47 [Messaging] debug tcp:127.0.0.1:5672 Connecting ...
2019-04-25 08:54:47 [Client] debug Set TCP_NODELAY
2019-04-25 08:54:47 [System] info Connecting: 127.0.0.1:5672
2019-04-25 08:54:47 [Messaging] debug tcp:127.0.0.1:5672 Connected
2019-04-25 08:54:47 [Messaging] debug wakeupDriver()
2019-04-25 08:54:47 [Messaging] debug tcp:127.0.0.1:5672 Waiting to be
authenticated...
2019-04-25 08:54:47 [Security] trace tcp:127.0.0.1:5672
Sasl::canEncode(): 1 || 0
2019-04-25 08:54:47 [Security] trace tcp:127.0.0.1:5672
Sasl::canEncode(): 1 || 0
2019-04-25 08:54:47 [Protocol] debug tcp:127.0.0.1:5672 writing protocol
header: 1-0
2019-04-25 08:54:47 [Security] trace tcp:127.0.0.1:5672
Sasl::encode(65535): 8
2019-04-25 08:54:47 [Security] trace tcp:127.0.0.1:5672
Sasl::canEncode(): 0 || 0
2019-04-25 08:54:47 [Protocol] debug tcp:127.0.0.1:5672 read protocol
header: 1-0
2019-04-25 08:54:47 [Security] trace tcp:127.0.0.1:5672 Sasl::decode(8): 8
2019-04-25 08:54:47 [Security] trace Reading SASL frame of size 52
2019-04-25 08:54:47 [Security] trace Reading SASL-MECHANISMS
2019-04-25 08:54:47 [Protocol] debug tcp:127.0.0.1:5672 Received
SASL-MECHANISMS(ANONYMOUS PLAIN AMQPLAIN )
2019-04-25 08:54:47 [Security] debug CyrusSasl::start(PLAIN )
2019-04-25 08:54:47 [Security] debug min_ssf: 0, max_ssf: 256
2019-04-25 08:54:47 [Security] debug getUserFromSettings(): p_21
2019-04-25 08:54:47 [Security] debug CyrusSasl::start(PLAIN ): selected
PLAIN response: '\x00p_21\x00p_21'
2019-04-25 08:54:47 [Security] trace Completed encoding of frame of 50 bytes
2019-04-25 08:54:47 [Protocol] debug tcp:127.0.0.1:5672 Sent
SASL-INIT(PLAIN, \x00p_21\x00p_21, 127.0.0.1)
2019-04-25 08:54:47 [Messaging] debug wakeupDriver()
2019-04-25 08:54:47 [Security] trace tcp:127.0.0.1:5672 Sasl::decode(52): 52
2019-04-25 08:54:47 [Security] trace tcp:127.0.0.1:5672
Sasl::canEncode(): 0 || 1
2019-04-25 08:54:47 [Security] trace tcp:127.0.0.1:5672
Sasl::canEncode(): 0 || 1
2019-04-25 08:54:47 [Security] trace tcp:127.0.0.1:5672
Sasl::encode(65535): 50
2019-04-25 08:54:47 [Security] trace tcp:127.0.0.1:5672
Sasl::canEncode(): 0 || 0
2019-04-25 08:54:47 [Security] trace Reading SASL frame of size 17
2019-04-25 08:54:47 [Security] trace Reading SASL-OUTCOME
2019-04-25 08:54:47 [Protocol] debug tcp:127.0.0.1:5672 Received
SASL-OUTCOME(\x00)
2019-04-25 08:54:47 [Messaging] debug wakeupDriver()
2019-04-25 08:54:47 [Security] trace tcp:127.0.0.1:5672 Sasl::decode(17): 17
2019-04-25 08:54:47 [Security] trace tcp:127.0.0.1:5672
Sasl::canEncode(): 0 || 0
2019-04-25 08:54:47 [Security] trace tcp:127.0.0.1:5672
Sasl::canEncode(): 0 || 0
2019-04-25 08:54:47 [Messaging] trace tcp:127.0.0.1:5672 encode(65535)
2019-04-25 08:54:47 [Protocol] trace
[8b0d2bba-7e5d-4d17-9fb1-2d9fd8c8a74c]:   -> AMQP
2019-04-25 08:54:47 [Network] debug tcp:127.0.0.1:5672 encoded 8 bytes
from 65535
2019-04-25 08:54:47 [Security] trace tcp:127.0.0.1:5672
Sasl::canEncode(): 0 || 0
2019-04-25 08:54:47 [Security] trace tcp:127.0.0.1:5672
Sasl::canEncode(): 0 || 0
2019-04-25 08:54:47 [Messaging] trace tcp:127.0.0.1:5672 encode(65535)
2019-04-25 08:54:47 [Security] trace tcp:127.0.0.1:5672
Sasl::canEncode(): 0 || 0
2019-04-25 08:54:47 [Messaging] trace tcp:127.0.0.1:5672 decode(8)
2019-04-25 08:54:47 [Protocol] trace
[8b0d2bba-7e5d-4d17-9fb1-2d9fd8c8a74c]:   <- AMQP
2019-04-25 08:54:47 [Network] debug tcp:127.0.0.1:5672 decoded 8 bytes
from 8
2019-04-25 08:54:47 [Messaging] debug tcp:127.0.0.1:5672 Authenticated
2019-04-25 08:54:47 [Messaging] debug tcp:127.0.0.1:5672 Opening...
2019-04-25 08:54:47 [Messaging] debug wakeupDriver()
2019-04-25 08:54:47 [Security] trace tcp:127.0.0.1:5672
Sasl::canEncode(): 0 || 0
2019-04-25 08:54:47 [Security] trace tcp:127.0.0.1:5672
Sasl::canEncode(): 0 || 0
2019-04-25 08:54:47 [Messaging] trace tcp:127.0.0.1:5672 encode(65535)
2019-04-25 08:54:47 [Protocol] trace
[8b0d2bba-7e5d-4d17-9fb1-2d9fd8c8a74c]: 0 -> @open(16)
[container-id="8b0d2bba-7e5d-4d17-9fb1-2d9fd8c8a74c", channel-max=32767,
properties={:"qpid.client_process"=:server, :"qpid.client_pid"=29847,
:"qpid.client_ppid"=63473}]
2019-04-25 08:54:47 [Network] debug tcp:127.0.0.1:5672 encoded 151 bytes
from 65535
2019-04-25 08:54:47 [Security] trace tcp:127.0.0.1:5672
Sasl::canEncode(): 0 || 0
2019-04-25 08:54:47 [Security] trace tcp:127.0.0.1:5672
Sasl::canEncode(): 0 || 0
2019-04-25 08:54:47 [Messaging] trace tcp:127.0.0.1:5672 encode(65535)
2019-04-25 08:54:47 [Security] trace tcp:127.0.0.1:5672
Sasl::canEncode(): 0 || 0
2019-04-25 08:54:47 [Messaging] trace tcp:127.0.0.1:5672 decode(277)
2019-04-25 08:54:47 [Protocol] trace
[8b0d2bba-7e5d-4d17-9fb1-2d9fd8c8a74c]: 0 <- @open(16)
[container-id="rabbit@stringc4", channel-max=32767, idle-time-out=60000,
properties={:"cluster_name"="rabbit@stringc4", :copyright="Copyright (C)
2007-2018 Pivotal Software, Inc.", :information="Licensed under the MPL.
  See http://www.rabbitmq.com/", :platform="Erlang/OTP 21.2.2",
:product="RabbitMQ", :version="3.7.10"}]
2019-04-25 08:54:47 [Network] debug tcp:127.0.0.1:5672 decoded 277 bytes
from 277
2019-04-25 08:54:47 [Messaging] debug tcp:127.0.0.1:5672 AMQP 1.0
idle-timeout set: local=0 remote=60000
2019-04-25 08:54:47 [Messaging] debug tcp:127.0.0.1:5672 Opened
2019-04-25 08:54:47 [Messaging] info Connected to tcp:127.0.0.1:5672


________________________________

Este correo electrónico y, en su caso, cualquier fichero anexo al mismo, contiene información de carácter confidencial exclusivamente dirigida a su destinatario o destinatarios. Si no es vd. el destinatario indicado, queda notificado que la lectura, utilización, divulgación y/o copia sin autorización está prohibida en virtud de la legislación vigente. En el caso de haber recibido este correo electrónico por error, se ruega notificar inmediatamente esta circunstancia mediante reenvío a la dirección electrónica del remitente.
Evite imprimir este mensaje si no es estrictamente necesario.

This email and any file attached to it (when applicable) contain(s) confidential information that is exclusively addressed to its recipient(s). If you are not the indicated recipient, you are informed that reading, using, disseminating and/or copying it without authorisation is forbidden in accordance with the legislation in effect. If you have received this email by mistake, please immediately notify the sender of the situation by resending it to their email address.
Avoid printing this message if it is not absolutely necessary.

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


Re: qpid-cpp and virtual host

Posted by Gordon Sim <gs...@redhat.com>.
On 25/04/2019 7:16 am, Jose Alberto Fernandez Parejo wrote:
> Hello Gordon,
> 
> Thank you very much for the quick response.
> 
> We have downloaded the new version including that commit. Now there is
> no error when calling
> 
> connection.setOption("virtualhost", "virtualhost_name");
> 
> But the client is connecting to default virtual host "/" and not to the
> one set with setOption procedure.
> 
> We are using rabbitmq broker. The logs of rabbitmq there is nothing
> regarding virtualhost when connecting.
> 
> Is there anything we can check to be sure we are not doing anything wrong?

Run with QPID_LOG_ENABLE=trace+ while connecting and check that the 
'open' frame's host field is set correctly.

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


Re: qpid-cpp and virtual host

Posted by Jose Alberto Fernandez Parejo <ja...@indra.es>.
Hello Gordon,

Thank you very much for the quick response.

We have downloaded the new version including that commit. Now there is
no error when calling

connection.setOption("virtualhost", "virtualhost_name");

But the client is connecting to default virtual host "/" and not to the
one set with setOption procedure.

We are using rabbitmq broker. The logs of rabbitmq there is nothing
regarding virtualhost when connecting.

Is there anything we can check to be sure we are not doing anything wrong?

Regards

On 24/04/2019 1:11 pm, Jose Alberto Fernandez Parejo wrote:
> So, Could we download the last changes from
> https://github.com/apache/qpid-cpp to use virtualhost?

Yes (or even just cherry-pick that commit if you prefer).

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

.


________________________________

Este correo electrónico y, en su caso, cualquier fichero anexo al mismo, contiene información de carácter confidencial exclusivamente dirigida a su destinatario o destinatarios. Si no es vd. el destinatario indicado, queda notificado que la lectura, utilización, divulgación y/o copia sin autorización está prohibida en virtud de la legislación vigente. En el caso de haber recibido este correo electrónico por error, se ruega notificar inmediatamente esta circunstancia mediante reenvío a la dirección electrónica del remitente.
Evite imprimir este mensaje si no es estrictamente necesario.

This email and any file attached to it (when applicable) contain(s) confidential information that is exclusively addressed to its recipient(s). If you are not the indicated recipient, you are informed that reading, using, disseminating and/or copying it without authorisation is forbidden in accordance with the legislation in effect. If you have received this email by mistake, please immediately notify the sender of the situation by resending it to their email address.
Avoid printing this message if it is not absolutely necessary.

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


Re: qpid-cpp and virtual host

Posted by Gordon Sim <gs...@redhat.com>.
On 24/04/2019 1:11 pm, Jose Alberto Fernandez Parejo wrote:
> So, Could we download the last changes from
> https://github.com/apache/qpid-cpp to use virtualhost?

Yes (or even just cherry-pick that commit if you prefer).

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


Re: qpid-cpp and virtual host

Posted by Jose Alberto Fernandez Parejo <ja...@indra.es>.
Hello Gordon,

Thank you very much.

So, Could we download the last changes from
https://github.com/apache/qpid-cpp to use virtualhost?

Regards

On 04/24/2019 08:59 AM, Gordon Sim wrote:
> On 24/04/2019 8:38 am, Jose Alberto Fernandez Parejo wrote:
>> Hello everyone,
>>
>>
>> We are using rabbitmq broker and qpid-cpp-1.38.0 API to send/receive
>> messages to/from broker.
>>
>> Our rabbitmq broker provider has defined a Virtual host at which queues
>> and exchange are created.
>>
>> We have seen that virtualhost can be setting by field "vhost:/" in
>> hostname. But we have made several test and it was not possible to set
>> the virtualhost.
>>
>> How can we address a virtualhost using qpid-cpp-1.38.0 API?
>> An example will be appreciated.
>>
>> Note that we are using AMQP1.0.
>
> Unfortunately it is not as yet possible. However I have now committed
> a fix to allow this to be controlled via the same 'virtualhost'
> connection option that is used for the 0-10 path. See
> https://issues.apache.org/jira/browse/QPID-8300.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>
> .
>


________________________________

Este correo electrónico y, en su caso, cualquier fichero anexo al mismo, contiene información de carácter confidencial exclusivamente dirigida a su destinatario o destinatarios. Si no es vd. el destinatario indicado, queda notificado que la lectura, utilización, divulgación y/o copia sin autorización está prohibida en virtud de la legislación vigente. En el caso de haber recibido este correo electrónico por error, se ruega notificar inmediatamente esta circunstancia mediante reenvío a la dirección electrónica del remitente.
Evite imprimir este mensaje si no es estrictamente necesario.

This email and any file attached to it (when applicable) contain(s) confidential information that is exclusively addressed to its recipient(s). If you are not the indicated recipient, you are informed that reading, using, disseminating and/or copying it without authorisation is forbidden in accordance with the legislation in effect. If you have received this email by mistake, please immediately notify the sender of the situation by resending it to their email address.
Avoid printing this message if it is not absolutely necessary.

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


Re: qpid-cpp and virtual host

Posted by Gordon Sim <gs...@redhat.com>.
On 24/04/2019 8:38 am, Jose Alberto Fernandez Parejo wrote:
> Hello everyone,
> 
> 
> We are using rabbitmq broker and qpid-cpp-1.38.0 API to send/receive
> messages to/from broker.
> 
> Our rabbitmq broker provider has defined a Virtual host at which queues
> and exchange are created.
> 
> We have seen that virtualhost can be setting by field "vhost:/" in
> hostname. But we have made several test and it was not possible to set
> the virtualhost.
> 
> How can we address a virtualhost using qpid-cpp-1.38.0 API?
> An example will be appreciated.
> 
> Note that we are using AMQP1.0.

Unfortunately it is not as yet possible. However I have now committed a 
fix to allow this to be controlled via the same 'virtualhost' connection 
option that is used for the 0-10 path. See 
https://issues.apache.org/jira/browse/QPID-8300.

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