You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Graham Leggett <mi...@sharp.fm> on 2013/10/10 14:56:11 UTC

Coaxing an error message out of qpid-cpp - unable to connect

Hi all,

I am currently trying to swap in qpid-cpp v0.18 to replace an unreliable activemq server installation. The connection is protected with client certificates.

When the client tries the connect, the qpid-client v0.24 reports a "java.net.SocketException: Broken pipe" and then hangs solid, the hang solid most probably due to bug https://issues.apache.org/jira/browse/QPID-5113. What I am after is why the "java.net.SocketException: Broken pipe".

I switched on what I thought was trace debugging in qpid-cpp using the "-t" command line option, but all I got was the trace below:

Oct 10 06:08:59 localhost qpidd[3027]: 2013-10-10 06:08:59 [Network] trace Accepting SSL connection.
Oct 10 06:08:59 localhost qpidd[3027]: 2013-10-10 06:08:59 [Network] trace Accepting SSL connection.
Oct 10 06:08:59 localhost qpidd[3027]: 2013-10-10 06:08:59 [Network] trace Accepting SSL connection.
Oct 10 06:08:59 localhost qpidd[3027]: 2013-10-10 06:08:59 [Network] trace Accepting SSL connection.
Oct 10 06:08:59 localhost qpidd[3027]: 2013-10-10 06:08:59 [Network] trace Accepting SSL connection.
Oct 10 06:08:59 localhost qpidd[3027]: 2013-10-10 06:08:59 [Network] trace Accepting SSL connection.
Oct 10 06:08:59 localhost qpidd[3027]: 2013-10-10 06:08:59 [Network] trace Accepting SSL connection.
Oct 10 06:08:59 localhost qpidd[3027]: 2013-10-10 06:08:59 [Network] trace Accepting SSL connection.
Oct 10 06:09:02 localhost qpidd[3027]: 2013-10-10 06:09:02 [Security] debug RECV [127.0.0.1:5671-127.0.0.1:50899]: INIT(
0-0)
Oct 10 06:09:02 localhost qpidd[3027]: 2013-10-10 06:09:02 [Security] debug RECV [127.0.0.1:5671-127.0.0.1:50898]: INIT(
0-0)
Oct 10 06:09:02 localhost qpidd[3027]: 2013-10-10 06:09:02 [Security] debug SENT [127.0.0.1:5671-127.0.0.1:50898]: INIT(
0-10)
Oct 10 06:09:02 localhost qpidd[3027]: 2013-10-10 06:09:02 [Security] debug SENT [127.0.0.1:5671-127.0.0.1:50899]: INIT(
0-10)
Oct 10 06:09:02 localhost qpidd[3027]: 2013-10-10 06:09:02 [Security] debug RECV [127.0.0.1:5671-127.0.0.1:50893]: INIT(
0-0)
Oct 10 06:09:02 localhost qpidd[3027]: 2013-10-10 06:09:02 [Security] debug SENT [127.0.0.1:5671-127.0.0.1:50893]: INIT(
0-10)
Oct 10 06:09:02 localhost qpidd[3027]: 2013-10-10 06:09:02 [Security] debug RECV [127.0.0.1:5671-127.0.0.1:50894]: INIT(
0-0)
Oct 10 06:09:02 localhost qpidd[3027]: 2013-10-10 06:09:02 [Security] debug RECV [127.0.0.1:5671-127.0.0.1:50895]: INIT(
0-0)
Oct 10 06:09:02 localhost qpidd[3027]: 2013-10-10 06:09:02 [Security] debug SENT [127.0.0.1:5671-127.0.0.1:50895]: INIT(
0-10)
Oct 10 06:09:02 localhost qpidd[3027]: 2013-10-10 06:09:02 [Security] debug RECV [127.0.0.1:5671-127.0.0.1:50897]: INIT(
0-0)
Oct 10 06:09:02 localhost qpidd[3027]: 2013-10-10 06:09:02 [Security] debug SENT [127.0.0.1:5671-127.0.0.1:50897]: INIT(
0-10)
Oct 10 06:09:02 localhost qpidd[3027]: 2013-10-10 06:09:02 [Security] debug SENT [127.0.0.1:5671-127.0.0.1:50894]: INIT(
0-10)
Oct 10 06:09:02 localhost qpidd[3027]: 2013-10-10 06:09:02 [Security] debug RECV [127.0.0.1:5671-127.0.0.1:50896]: INIT(
0-0)
Oct 10 06:09:02 localhost qpidd[3027]: 2013-10-10 06:09:02 [Security] debug SENT [127.0.0.1:5671-127.0.0.1:50896]: INIT(
0-10)

Is there some kind of command line option over and above the -t that tells qpid-cpp to log errors? If I had an error message, I could debug this, right now all I have is a disconnect followed by silence.

The stack trace on the client side is as follows for each failed connection:

java.net.SocketException: Broken pipe
        at java.net.SocketOutputStream.socketWrite0(Native Method)
        at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
        at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
        at sun.security.ssl.OutputRecord.writeBuffer(OutputRecord.java:377)
        at sun.security.ssl.OutputRecord.write(OutputRecord.java:363)
        at sun.security.ssl.SSLSocketImpl.writeRecordInternal(SSLSocketImpl.java:830)
        at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:801)
        at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:122)
        at org.apache.qpid.amqp_1_0.framing.ConnectionHandler$BytesOutputHandler.processBytes(ConnectionHandler.java:418)
        at org.apache.qpid.amqp_1_0.framing.ConnectionHandler$FrameToBytesSourceAdapter.getBytes(ConnectionHandler.java:305)
        at org.apache.qpid.amqp_1_0.framing.ConnectionHandler$SequentialBytesSource.getBytes(ConnectionHandler.java:371)
        at org.apache.qpid.amqp_1_0.framing.ConnectionHandler$BytesOutputHandler.run(ConnectionHandler.java:404)
        at java.lang.Thread.run(Thread.java:724)

The command line options for qpid-cpp are as follows:

qpidd     3027  0.5  0.8 299072  4336 ?        Ssl  06:07   0:04 /usr/sbin/qpidd --data-dir /var/lib/qpidd --daemon -t --port 5672 --ssl-cert-db sql:/etc/pki/nssdb --ssl-cert-name Server-Cert --ssl-port 5671 --ssl-require-client-authentication --ssl-sasl-no-dict

Regards,
Graham
--


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


Re: Coaxing an error message out of qpid-cpp - unable to connect

Posted by Oleksandr Rudyy <or...@gmail.com>.
Hi Graham,

The JMS client exception stack trace indicates that you are using AMQP
1.0 JMS client with 0.18 Broker which does not speak AMQP 1.0. The
support for AMQP 1.0 was introduced in 0.20 version of Qpid cpp
broker.

0.18 Broker supports only AMQP 0.10. You can use Qpid JMS Client which
speaks AMQP 0-8/0-9/0-9-1/0-10 protocols. That client should be
already on your classpath ( qpid-client-0.24.jar,
qpid-common-0.24.jar).
Please, have a look at examples at [1] to see how to connect that
client to the Broker. You can declare
org.apache.qpid.jndi.PropertiesFileInitialContextFactory as
java.naming.factory.initial in your jndi.properties which should
provide the right connection factory and destinations for you.

If you need to use AMQP 1.0 then you have to upgrade the Broker.

Kind Regards,
Alex

[1] http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/client/example/src/main/java/org/apache/qpid/example/


>> When the client tries the connect, the qpid-client v0.24 reports a "java.net.SocketException: Broken pipe" and then hangs solid, the hang solid most probably due to bug https://issues.apache.org/jira/browse/QPID-5113. What I am after is why the "java.net.SocketException: Broken pipe".
>
> Digging further with ssldump, I find that the SSL connections are completing successfully, the client and server then try to negotiate the protocol, and the server puts the phone down on the connection as follows:
>
> 1 5  6.8968 (0.0001)  C>S  ChangeCipherSpec
> 1 6  7.0251 (0.1282)  C>S  Handshake
>       Finished
> 1 7  7.0273 (0.0022)  S>C  ChangeCipherSpec
> 1 8  7.0273 (0.0000)  S>C  Handshake
>       Finished
> 1 9  7.0349 (0.0075)  C>S  application_data
>     ---------------------------------------------------------------
>     41 4d 51 50 00 01 00 00                            AMQP....
>     ---------------------------------------------------------------
> 1 10 7.1535 (0.1185)  S>C  application_data
>     ---------------------------------------------------------------
>     41 4d 51 50 01 01 00 0a                            AMQP....
>     ---------------------------------------------------------------
> 1 11 7.2002 (0.0467)  S>C  Alert
>     level           warning
>     value           close_notify
> 1    7.2011 (0.0008)  S>C  TCP FIN
> 1 12 7.2405 (0.0394)  C>S  application_data
>     ---------------------------------------------------------------
>     00 00 00 50 02 00 00 00 00 53 10 c0 43 04 a1 1d    ...P.....S..C...
>     6c 6f 63 61 6c 68 6f 73 74 2e 6c 6f 63 61 6c 64    localhost.locald
>     6f 6d 61 69 6e 28 35 32 33 39 29 3a 32 a1 19 61    omain(5239):2..a
>     6d 71 70 2e 73 61 6e 64 62 6f 78 2e xx xx xx xx    mqp.sandbox.xxxx
>     xx xx xx xx 2e 6e 65 74 70 00 01 00 00 60 00 ff    xxxx.netp....`..
>     ---------------------------------------------------------------
> 1    7.5397 (0.2992)  C>S  TCP RST
>
> Is this a mismatch between the protocol on client and server?
>
> The client says "41 4d 51 50 00 01 00 00", the server then responds "41 4d 51 50 01 01 00 0a" and puts the phone down. Am I right in assuming that "00 01 00 00" and "01 01 00 0a" are protocol version numbers?
>
> The client jars are as follows:
>
> -rw-r--r-- 1 root transcode  471270 Oct 10 05:40 qpid-client-0.24.jar
> -rw-r--r-- 1 root transcode 1379470 Oct 10 05:41 qpid-common-0.24.jar
> -rw-r--r-- 1 root transcode   25942 Oct 10 05:41 slf4j-api-1.6.4.jar
>
> Are these compatible with a v0.18 qpid-cpp server?
>
> Regards,
> Graham
> --
>
>
> ---------------------------------------------------------------------
> 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: Coaxing an error message out of qpid-cpp - unable to connect

Posted by Graham Leggett <mi...@sharp.fm>.
On 10 Oct 2013, at 2:56 PM, Graham Leggett <mi...@sharp.fm> wrote:

> When the client tries the connect, the qpid-client v0.24 reports a "java.net.SocketException: Broken pipe" and then hangs solid, the hang solid most probably due to bug https://issues.apache.org/jira/browse/QPID-5113. What I am after is why the "java.net.SocketException: Broken pipe".

Digging further with ssldump, I find that the SSL connections are completing successfully, the client and server then try to negotiate the protocol, and the server puts the phone down on the connection as follows:

1 5  6.8968 (0.0001)  C>S  ChangeCipherSpec
1 6  7.0251 (0.1282)  C>S  Handshake
      Finished
1 7  7.0273 (0.0022)  S>C  ChangeCipherSpec
1 8  7.0273 (0.0000)  S>C  Handshake
      Finished
1 9  7.0349 (0.0075)  C>S  application_data
    ---------------------------------------------------------------
    41 4d 51 50 00 01 00 00                            AMQP....
    ---------------------------------------------------------------
1 10 7.1535 (0.1185)  S>C  application_data
    ---------------------------------------------------------------
    41 4d 51 50 01 01 00 0a                            AMQP....
    ---------------------------------------------------------------
1 11 7.2002 (0.0467)  S>C  Alert
    level           warning
    value           close_notify
1    7.2011 (0.0008)  S>C  TCP FIN
1 12 7.2405 (0.0394)  C>S  application_data
    ---------------------------------------------------------------
    00 00 00 50 02 00 00 00 00 53 10 c0 43 04 a1 1d    ...P.....S..C...
    6c 6f 63 61 6c 68 6f 73 74 2e 6c 6f 63 61 6c 64    localhost.locald
    6f 6d 61 69 6e 28 35 32 33 39 29 3a 32 a1 19 61    omain(5239):2..a
    6d 71 70 2e 73 61 6e 64 62 6f 78 2e xx xx xx xx    mqp.sandbox.xxxx
    xx xx xx xx 2e 6e 65 74 70 00 01 00 00 60 00 ff    xxxx.netp....`..
    ---------------------------------------------------------------
1    7.5397 (0.2992)  C>S  TCP RST

Is this a mismatch between the protocol on client and server?

The client says "41 4d 51 50 00 01 00 00", the server then responds "41 4d 51 50 01 01 00 0a" and puts the phone down. Am I right in assuming that "00 01 00 00" and "01 01 00 0a" are protocol version numbers?

The client jars are as follows:

-rw-r--r-- 1 root transcode  471270 Oct 10 05:40 qpid-client-0.24.jar
-rw-r--r-- 1 root transcode 1379470 Oct 10 05:41 qpid-common-0.24.jar
-rw-r--r-- 1 root transcode   25942 Oct 10 05:41 slf4j-api-1.6.4.jar

Are these compatible with a v0.18 qpid-cpp server?

Regards,
Graham
--


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


Re: Coaxing an error message out of qpid-cpp - unable to connect

Posted by Graham Leggett <mi...@sharp.fm>.
On 10 Oct 2013, at 6:08 PM, Graham Leggett <mi...@sharp.fm> wrote:

> javax.jms.JMSException: Failed to parse entry: Not an AMQP URL amqps://amqp.sandbox.xxx.net:5671?jms.prefetchPolicy.queuePrefetch=1 due to : Not an AMQP URL: amqps://amqp.sandbox.xxx.net:5671?jms.prefetchPolicy.queuePrefetch=1
> 
> The URL worked fine with qpid-java-amqp-1-0-client-jms, but suddenly doesn't work with qpid-java-client - does the older JMS driver support SSL?

As an alternative I tried to modify the URL to be amqp://amqp.sandbox.xxx.net:5671?ssl=true&jms.prefetchPolicy.queuePrefetch=1, and now I get the following equally mystifying error:

javax.jms.JMSException: Failed to parse entry: Virtual host found between indicies 7 and 25 
amqp://amqp.sandbox.xxx.net:5671?ssl=true&jms.prefetchPolicy.queuePrefetch=1
       ^^^^^^^^^^^^^^^^^^^^^^^^^ due to : Virtual host found at index 7: amqp://amqp.sandbox.xxx.net:5671?ssl=true&jms.prefetchPolicy.queuePrefetch=1

Anyone know why the qpid-client JMS API should find virtual hosts offensive?

Regards,
Graham
--


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


Re: Coaxing an error message out of qpid-cpp - unable to connect

Posted by Robbie Gemmell <ro...@gmail.com>.
The AMQP 1.0 client and AMQP 0-10 client dont share a common configuration,
and it looks like you are mixing the two.

See
http://qpid.apache.org/releases/qpid-0.24/programming/book/QpidJNDI.html#section-jms-connection-urlfor
documentation for the 0-10 client Connection URLs.

You might want to try something like:
amqp://user:pass@clientid/vhost?brokerlist='tcp://host:port?ssl='true''

Robbie

On 10 October 2013 17:08, Graham Leggett <mi...@sharp.fm> wrote:

> On 10 Oct 2013, at 4:57 PM, Gordon Sim <gs...@redhat.com> wrote:
>
> >> I have tried qpid-java-client (expecting it to work) and
> qpid-java-amqp-1-0-client-jms (expecting it to give me a clear "protocol
> not supported" error) v0.24 and v0.18, and all 4 fail with the same
> "java.net.SocketException: Broken pipe".
> >
> > Sorry its been so difficult. You need different configuration properties
> to switch between the 1.0 client and the earlier one.
>
> More investigation has shown that someone had hard coded the qpid ampq
> v1.0 driver directly into the code, which was taking precedence. With that
> removed we're now getting further, but still not out of the woods:
>
> javax.jms.JMSException: Failed to parse entry: Not an AMQP URL amqps://
> amqp.sandbox.xxx.net:5671?jms.prefetchPolicy.queuePrefetch=1 due to : Not
> an AMQP URL: amqps://
> amqp.sandbox.xxx.net:5671?jms.prefetchPolicy.queuePrefetch=1
>
> The URL worked fine with qpid-java-amqp-1-0-client-jms, but suddenly
> doesn't work with qpid-java-client - does the older JMS driver support SSL?
>
> >> Can anyone confirm whether any of the Qpid Java code interoperates in
> any way with the Qpid C++ code?
> >
> > Yes, it definitely does. The first thing I'd try is getting a simple
> example working without SSL, then redo with SSL enabled. That will make any
> issues easier to pinpoint I believe.
>
> SSL is required in our system, so getting it working without doesn't help
> us. We have the ability to sniff the connection through SSL and debug it,
> so it isn't a problem (until the problem above).
>
> Regards,
> Graham
> --
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>
>

Re: Coaxing an error message out of qpid-cpp - unable to connect

Posted by Gordon Sim <gs...@redhat.com>.
On 10/11/2013 10:16 AM, Graham Leggett wrote:
> Is there a way to set this globally, or do we have to make qpid-specific changes to our code to do this?

Not yet, I'm afraid. However strangely enough I just recently posted on 
this very topic with a proposal to add some way of doing exactly this. I 
hope to add something soon.

Do you only want to have queues created on the fly, or also topics? The 
reason being that distinguishing between these is a little arbitrary at 
present. ActiveMQ uses a convention of prefixing the name with 
'topic://' if it is to be a topic.

Possibly not an attractive option, but if you really need this and must 
move from ActiveMQ[1], then hacking the Qpid c++ broker to always create 
queues on demand would not be difficult. (That would still leave the 
issue of queue v. topic however).

[1] Did you try ApolloMQ? It has the same create-on-demand behaviour.

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


Re: Coaxing an error message out of qpid-cpp - unable to connect

Posted by Gordon Sim <gs...@redhat.com>.
On 10/11/2013 11:01 AM, Robbie Gemmell wrote:
> As you have noticed, Destination strings are provider-specific in nature.
> The way you would insulate your code from changes to make it more portable
> would be to use JNDI to provider the provider-specific configuration for
> them and then look them up in a provider-neutral manner.

Yes, this is a very good point. I shouldn't have leapt so quickly to 
suggestions of hacking the broker :-)

Are you using the Session.createQueue() method?

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


Re: Coaxing an error message out of qpid-cpp - unable to connect

Posted by Robbie Gemmell <ro...@gmail.com>.
I don't believe the client has a global flag to do that, no. The current
'Address' string syntax for the client requires the application specify the
behaviour it wants. When using the older 'BindingURL' format (
https://cwiki.apache.org/confluence/display/qpid/BindingURLFormat) for
destination strings the client will automatically create queues when
creating a consumer, but not when creating producers.

As you have noticed, Destination strings are provider-specific in nature.
The way you would insulate your code from changes to make it more portable
would be to use JNDI to provider the provider-specific configuration for
them and then look them up in a provider-neutral manner.

http://qpid.apache.org/releases/qpid-0.24/programming/book/QpidJNDI.html

Robbie

On 11 October 2013 10:16, Graham Leggett <mi...@sharp.fm> wrote:

> On 11 Oct 2013, at 9:38 AM, Robbie Gemmell <ro...@gmail.com>
> wrote:
>
> > You can control creation of queues through options in your destination
> > strings, e.g instructing your producers/consumers/both to ensure the
> queue
> > is created when they start up.
> >
> > The documentation for the address strings is at:
> >
> http://qpid.apache.org/releases/qpid-0.24/programming/book/section-addresses.html
> >
> > A simple example showing an address (the bit in quotes) indicating for
> both
> > consumers and producers to create the queue is:
> >
> http://qpid.apache.org/releases/qpid-0.24/programming/book/section-addresses.html#idm241445126208
>
> Is there a way to set this globally, or do we have to make qpid-specific
> changes to our code to do this?
>
> What I am trying to achieve is that the service that requires the queues
> is self sufficient, if the queues don't exist they're just created and the
> application just gets on with it, while at the same time being portable.
> Unfortunately the JMS spec has dictated to everybody that queue creation
> must be done manually by an administrator[1], which adds an unnecessary
> point of failure for us that I am very keen to avoid.
>
> [1]
> http://docs.oracle.com/javaee/1.4/api/javax/jms/Session.html#createQueue%28java.lang.String%29
>
> Regards,
> Graham
> --
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>
>

Re: Coaxing an error message out of qpid-cpp - unable to connect

Posted by Graham Leggett <mi...@sharp.fm>.
On 11 Oct 2013, at 9:38 AM, Robbie Gemmell <ro...@gmail.com> wrote:

> You can control creation of queues through options in your destination
> strings, e.g instructing your producers/consumers/both to ensure the queue
> is created when they start up.
> 
> The documentation for the address strings is at:
> http://qpid.apache.org/releases/qpid-0.24/programming/book/section-addresses.html
> 
> A simple example showing an address (the bit in quotes) indicating for both
> consumers and producers to create the queue is:
> http://qpid.apache.org/releases/qpid-0.24/programming/book/section-addresses.html#idm241445126208

Is there a way to set this globally, or do we have to make qpid-specific changes to our code to do this?

What I am trying to achieve is that the service that requires the queues is self sufficient, if the queues don't exist they're just created and the application just gets on with it, while at the same time being portable. Unfortunately the JMS spec has dictated to everybody that queue creation must be done manually by an administrator[1], which adds an unnecessary point of failure for us that I am very keen to avoid.

[1] http://docs.oracle.com/javaee/1.4/api/javax/jms/Session.html#createQueue%28java.lang.String%29

Regards,
Graham
--


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


Re: Coaxing an error message out of qpid-cpp - unable to connect

Posted by Robbie Gemmell <ro...@gmail.com>.
You can control creation of queues through options in your destination
strings, e.g instructing your producers/consumers/both to ensure the queue
is created when they start up.

The documentation for the address strings is at:
http://qpid.apache.org/releases/qpid-0.24/programming/book/section-addresses.html

A simple example showing an address (the bit in quotes) indicating for both
consumers and producers to create the queue is:
http://qpid.apache.org/releases/qpid-0.24/programming/book/section-addresses.html#idm241445126208

Robbie

On 11 October 2013 00:53, Graham Leggett <mi...@sharp.fm> wrote:

> On 10 Oct 2013, at 6:36 PM, Gordon Sim <gs...@redhat.com> wrote:
>
> > Yes it does, but the configuration is entirely different between these
> two clients. In particular I don't believe the 0.8/0-9-1/0-10 client uses
> 'amqps' to indicate ssl is to be used:
> >
> > http://qpid.apache.org/releases/qpid-0.24/programming/book/QpidJNDI.html
> >
> > From the examples in section  3.4 I think the "url" you would be looking
> for would be:
> >
> > amqp://guest:guest@client_id/test?maxprefetch=1 &brokerlist='tcp://
> amqp.sandbox.xxx.net:5671?ssl='true'sasl_mechs='EXTERNAL''
> >
> > The client_id can be one of your own choosing of course and the username
> and password won't actually be chosen if you are using EXTERNAL
> authentication.
> >
> > If you want to use a specific certificate you would use:
> >
> > amqp://guest:guest@client_id/test?maxprefetch=1
> >        &brokerlist='tcp://
> amqp.sandbox.xxx.net:5671?ssl='true'&ssl_cert_alias='cert1'&sasl_mechs='EXTERNAL
> ''
>
> Thank you for the clarification, what eventually triggered a successful
> connection was the following URL, which included quotes:
>
>
> amqp://transcode/queue?maxprefetch='1'&amp;brokerlist='tcp://amqp.${env:SERVER_ENV}.
> xxx.net:5671?ssl='true'&amp;sasl_mechs='ANONYMOUS''
>
> We've run into the next problem which seems to be a difference between
> activemq and qpid, it seems qpid wants the queues to be statically defined:
>
> javax.jms.JMSException: Error registering consumer:
> org.apache.qpid.AMQException: The name 'video_audio_demux_queue' supplied
> in the address doesn't resolve to an exchange or a queue
>
> Is there a way to dynamically define queues like activemq can?
>
> Regards,
> Graham
> --
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>
>

Re: Coaxing an error message out of qpid-cpp - unable to connect

Posted by Graham Leggett <mi...@sharp.fm>.
On 10 Oct 2013, at 6:36 PM, Gordon Sim <gs...@redhat.com> wrote:

> Yes it does, but the configuration is entirely different between these two clients. In particular I don't believe the 0.8/0-9-1/0-10 client uses 'amqps' to indicate ssl is to be used:
> 
> http://qpid.apache.org/releases/qpid-0.24/programming/book/QpidJNDI.html
> 
> From the examples in section  3.4 I think the "url" you would be looking for would be:
> 
> amqp://guest:guest@client_id/test?maxprefetch=1 &brokerlist='tcp://amqp.sandbox.xxx.net:5671?ssl='true'sasl_mechs='EXTERNAL''
> 
> The client_id can be one of your own choosing of course and the username and password won't actually be chosen if you are using EXTERNAL authentication.
> 
> If you want to use a specific certificate you would use:
> 
> amqp://guest:guest@client_id/test?maxprefetch=1
> 	 &brokerlist='tcp://amqp.sandbox.xxx.net:5671?ssl='true'&ssl_cert_alias='cert1'&sasl_mechs='EXTERNAL''

Thank you for the clarification, what eventually triggered a successful connection was the following URL, which included quotes:

amqp://transcode/queue?maxprefetch='1'&amp;brokerlist='tcp://amqp.${env:SERVER_ENV}.xxx.net:5671?ssl='true'&amp;sasl_mechs='ANONYMOUS''

We've run into the next problem which seems to be a difference between activemq and qpid, it seems qpid wants the queues to be statically defined:

javax.jms.JMSException: Error registering consumer: org.apache.qpid.AMQException: The name 'video_audio_demux_queue' supplied in the address doesn't resolve to an exchange or a queue

Is there a way to dynamically define queues like activemq can?

Regards,
Graham
--


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


Re: Coaxing an error message out of qpid-cpp - unable to connect

Posted by Gordon Sim <gs...@redhat.com>.
On 10/10/2013 05:08 PM, Graham Leggett wrote:
> More investigation has shown that someone had hard coded the qpid ampq v1.0 driver directly into the code, which was taking precedence. With that removed we're now getting further, but still not out of the woods:
>
> javax.jms.JMSException: Failed to parse entry: Not an AMQP URL amqps://amqp.sandbox.xxx.net:5671?jms.prefetchPolicy.queuePrefetch=1 due to : Not an AMQP URL: amqps://amqp.sandbox.xxx.net:5671?jms.prefetchPolicy.queuePrefetch=1
>
> The URL worked fine with qpid-java-amqp-1-0-client-jms, but suddenly doesn't work with qpid-java-client - does the older JMS driver support SSL?

Yes it does, but the configuration is entirely different between these 
two clients. In particular I don't believe the 0.8/0-9-1/0-10 client 
uses 'amqps' to indicate ssl is to be used:

http://qpid.apache.org/releases/qpid-0.24/programming/book/QpidJNDI.html

 From the examples in section  3.4 I think the "url" you would be 
looking for would be:

amqp://guest:guest@client_id/test?maxprefetch=1 
&brokerlist='tcp://amqp.sandbox.xxx.net:5671?ssl='true'sasl_mechs='EXTERNAL''

The client_id can be one of your own choosing of course and the username 
and password won't actually be chosen if you are using EXTERNAL 
authentication.

If you want to use a specific certificate you would use:

amqp://guest:guest@client_id/test?maxprefetch=1
	 
&brokerlist='tcp://amqp.sandbox.xxx.net:5671?ssl='true'&ssl_cert_alias='cert1'&sasl_mechs='EXTERNAL''


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


Re: Coaxing an error message out of qpid-cpp - unable to connect

Posted by Graham Leggett <mi...@sharp.fm>.
On 10 Oct 2013, at 4:57 PM, Gordon Sim <gs...@redhat.com> wrote:

>> I have tried qpid-java-client (expecting it to work) and qpid-java-amqp-1-0-client-jms (expecting it to give me a clear "protocol not supported" error) v0.24 and v0.18, and all 4 fail with the same "java.net.SocketException: Broken pipe".
> 
> Sorry its been so difficult. You need different configuration properties to switch between the 1.0 client and the earlier one.

More investigation has shown that someone had hard coded the qpid ampq v1.0 driver directly into the code, which was taking precedence. With that removed we're now getting further, but still not out of the woods:

javax.jms.JMSException: Failed to parse entry: Not an AMQP URL amqps://amqp.sandbox.xxx.net:5671?jms.prefetchPolicy.queuePrefetch=1 due to : Not an AMQP URL: amqps://amqp.sandbox.xxx.net:5671?jms.prefetchPolicy.queuePrefetch=1

The URL worked fine with qpid-java-amqp-1-0-client-jms, but suddenly doesn't work with qpid-java-client - does the older JMS driver support SSL?

>> Can anyone confirm whether any of the Qpid Java code interoperates in any way with the Qpid C++ code?
> 
> Yes, it definitely does. The first thing I'd try is getting a simple example working without SSL, then redo with SSL enabled. That will make any issues easier to pinpoint I believe.

SSL is required in our system, so getting it working without doesn't help us. We have the ability to sniff the connection through SSL and debug it, so it isn't a problem (until the problem above).

Regards,
Graham
--


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


Re: Coaxing an error message out of qpid-cpp - unable to connect

Posted by Gordon Sim <gs...@redhat.com>.
On 10/10/2013 03:33 PM, Graham Leggett wrote:
> On 10 Oct 2013, at 4:08 PM, Gordon Sim <gs...@redhat.com> wrote:
>
>> Do you have the AMQP 1.0 plugin for the broker? It would be in the module-dir, the default for which should be indicated by /usr/sbin/qpidd --help
>>
>> My guess is that it is not there or is not being loaded. Without it qpidd only speaks 0-10.
>
> I guess not:
>
> [root@localhost ~]# ls -al /usr/lib64/qpid/daemon
> total 1688
> drwxr-xr-x 2 root root   4096 Oct 10 04:41 .
> drwxr-xr-x 4 root root   4096 Jul 12 08:35 ..
> -rwxr-xr-x 1 root root 366432 Jul 12 08:35 acl.so
> -rwxr-xr-x 1 root root 997240 Jul 12 08:35 msgstore.so
> -rwxr-xr-x 1 root root 131144 Jul 12 08:35 replicating_listener.so
> -rwxr-xr-x 1 root root  54320 Jul 12 08:35 replication_exchange.so
> -rwxr-xr-x 1 root root 156992 Jul 12 08:35 ssl.so
>
> (I am using qpid-cpp v0.18 as published by CERN: http://linux.web.cern.ch/linux/mrg/)

As Alex pointed out, 0.18 did not yet include support for AMQP 1.0.

> My question now becomes, what qpid JMS client speaks 0-10?

The main Qpid JMS client speaks 0-10 (as well as 0-8 and 0-9)

> I have tried qpid-java-client (expecting it to work) and qpid-java-amqp-1-0-client-jms (expecting it to give me a clear "protocol not supported" error) v0.24 and v0.18, and all 4 fail with the same "java.net.SocketException: Broken pipe".

Sorry its been so difficult. You need different configuration properties 
to switch between the 1.0 client and the earlier one.

> Can anyone confirm whether any of the Qpid Java code interoperates in any way with the Qpid C++ code?

Yes, it definitely does. The first thing I'd try is getting a simple 
example working without SSL, then redo with SSL enabled. That will make 
any issues easier to pinpoint I believe.


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


Re: Coaxing an error message out of qpid-cpp - unable to connect

Posted by Graham Leggett <mi...@sharp.fm>.
On 10 Oct 2013, at 4:08 PM, Gordon Sim <gs...@redhat.com> wrote:

> Do you have the AMQP 1.0 plugin for the broker? It would be in the module-dir, the default for which should be indicated by /usr/sbin/qpidd --help
> 
> My guess is that it is not there or is not being loaded. Without it qpidd only speaks 0-10.

I guess not:

[root@localhost ~]# ls -al /usr/lib64/qpid/daemon
total 1688
drwxr-xr-x 2 root root   4096 Oct 10 04:41 .
drwxr-xr-x 4 root root   4096 Jul 12 08:35 ..
-rwxr-xr-x 1 root root 366432 Jul 12 08:35 acl.so
-rwxr-xr-x 1 root root 997240 Jul 12 08:35 msgstore.so
-rwxr-xr-x 1 root root 131144 Jul 12 08:35 replicating_listener.so
-rwxr-xr-x 1 root root  54320 Jul 12 08:35 replication_exchange.so
-rwxr-xr-x 1 root root 156992 Jul 12 08:35 ssl.so

(I am using qpid-cpp v0.18 as published by CERN: http://linux.web.cern.ch/linux/mrg/)

My question now becomes, what qpid JMS client speaks 0-10?

I have tried qpid-java-client (expecting it to work) and qpid-java-amqp-1-0-client-jms (expecting it to give me a clear "protocol not supported" error) v0.24 and v0.18, and all 4 fail with the same "java.net.SocketException: Broken pipe".

Can anyone confirm whether any of the Qpid Java code interoperates in any way with the Qpid C++ code?

Regards,
Graham
--


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


Re: Coaxing an error message out of qpid-cpp - unable to connect

Posted by Gordon Sim <gs...@redhat.com>.
On 10/10/2013 01:56 PM, Graham Leggett wrote:
> The stack trace on the client side is as follows for each failed connection:
>
> java.net.SocketException: Broken pipe
>          at java.net.SocketOutputStream.socketWrite0(Native Method)
>          at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
>          at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
>          at sun.security.ssl.OutputRecord.writeBuffer(OutputRecord.java:377)
>          at sun.security.ssl.OutputRecord.write(OutputRecord.java:363)
>          at sun.security.ssl.SSLSocketImpl.writeRecordInternal(SSLSocketImpl.java:830)
>          at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:801)
>          at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:122)
>          at org.apache.qpid.amqp_1_0.framing.ConnectionHandler$BytesOutputHandler.processBytes(ConnectionHandler.java:418)
>          at org.apache.qpid.amqp_1_0.framing.ConnectionHandler$FrameToBytesSourceAdapter.getBytes(ConnectionHandler.java:305)
>          at org.apache.qpid.amqp_1_0.framing.ConnectionHandler$SequentialBytesSource.getBytes(ConnectionHandler.java:371)
>          at org.apache.qpid.amqp_1_0.framing.ConnectionHandler$BytesOutputHandler.run(ConnectionHandler.java:404)
>          at java.lang.Thread.run(Thread.java:724)
>
> The command line options for qpid-cpp are as follows:
>
> qpidd     3027  0.5  0.8 299072  4336 ?        Ssl  06:07   0:04 /usr/sbin/qpidd --data-dir /var/lib/qpidd --daemon -t --port 5672 --ssl-cert-db sql:/etc/pki/nssdb --ssl-cert-name Server-Cert --ssl-port 5671 --ssl-require-client-authentication --ssl-sasl-no-dict

Do you have the AMQP 1.0 plugin for the broker? It would be in the 
module-dir, the default for which should be indicated by /usr/sbin/qpidd 
--help

My guess is that it is not there or is not being loaded. Without it 
qpidd only speaks 0-10.

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