qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robbie Gemmell <robbie.gemm...@gmail.com>
Subject Re: [Router][Java Broker] connect failed between Router & Java Broker
Date Wed, 09 Dec 2015 10:06:42 GMT
On 8 December 2015 at 21:21, Olivier Mallassi
<olivier.mallassi@gmail.com> wrote:
> Thx,
>
> The missing piece *was the assignement of the authent provider to a port *....
> sorry about that.
>
> *So now, and to recap*,
> - my Java Broker (0.32) has two ports with two different authentication
> provider (pwdFile & anonymous). @Keith, in my case, I am specifying the
> username / pwd in the createConnection(user, pwd) (JMS API) and not in the
> url (like amqp://user:pwd@.....) I think this is why it worked
>
> - my router is configured to route message to the anonymous port
> (connector).
>
> then on the qrouterd side (after activating the trace), I got
>
> [0x7f4f9000d980]:  -> SASL
> [0x7f4f9000d980]:0 -> @sasl-init(65) [mechanism=:ANONYMOUS,
> initial-response=b"anonymous"]
> [0x7f4f9000d980]:  -> AMQP
> [0x7f4f9000d980]:0 -> @open(16) [container-id="qpid.dispatch.router.A",
> max-frame-size=65536, channel-max=32767,
> offered-capabilities=:"ANONYMOUS-RELAY",
> properties={:product="qpid-dispatch-router", :version="0.5"}]
> [0x7f4f9000d980]:  <- SASL
>
>
>
>
> *Yet and now I am facing a "JMSException: Delivery failed: failure at
> remote"*
>
> - I am basically trying to reproduce the distributed topic Jack Gibson did (
> http://qpid.2158936.n2.nabble.com/Dispatch-Router-distributed-topics-td7611684.html).
> I have exactly the same use case:
>
>
> *on router side*
>
> Accepted from 192.168.56.102:59820
> [0x1818ed0]:  <- SASL
> [0x1818ed0]:  -> SASL
> [0x1818ed0]:0 -> @sasl-mechanisms(64)
> [sasl-server-mechanisms=@PN_SYMBOL[:ANONYMOUS]]
> [0x1818ed0]:0 <- @sasl-init(65) [mechanism=:ANONYMOUS,
> initial-response=b"", hostname="192.168.56.103"]
> [0x1818ed0]:0 -> @sasl-outcome(68) [code=0]
> [0x1818ed0]:  <- AMQP
> [0x1818ed0]:0 <- @open(16)
> [container-id="ID:POMALLASSI-59817-1449570029482-1:1",
> hostname="192.168.56.103", max-frame-size=1048576, channel-max=32767,
> idle-time-out=30000,
> desired-capabilities=@PN_SYMBOL[:"sole-connection-for-container"],
> properties={:product="QpidJMS", :version="0.6.0", :platform="JVM: 1.7.0_40,
> 24.0-b56, Oracle Corporation, OS: Windows 7, 6.1, x86"}]
> [0x1818ed0]:  -> AMQP
> [0x1818ed0]:0 -> @open(16) [container-id="qpid.dispatch.router.A",
> max-frame-size=65536, channel-max=32767,
> offered-capabilities=:"ANONYMOUS-RELAY",
> properties={:product="qpid-dispatch-router", :version="0.5"}]
> [0x1818ed0]:0 <- @begin(17) [next-outgoing-id=1, incoming-window=2047,
> outgoing-window=2147483647, handle-max=65535]
> [0x1818ed0]:0 -> @begin(17) [remote-channel=0, next-outgoing-id=0,
> incoming-window=15, outgoing-window=2147483647]
> [0x1818ed0]:1 <- @begin(17) [next-outgoing-id=1, incoming-window=2047,
> outgoing-window=2147483647, handle-max=65535]
> [0x1818ed0]:1 -> @begin(17) [remote-channel=1, next-outgoing-id=0,
> incoming-window=15, outgoing-window=2147483647]
> [0x1818ed0]:1 <- @attach(18)
> [name="qpid-jms:sender:ID:POMALLASSI-59817-1449570029482-0:1:1:1:payments",
> handle=0, role=false, snd-settle-mode=0, rcv-settle-mode=0,
> source=@source(40) [address="ID:POMALLASSI-59817-1449570029482-0:1:1:1",
> durable=0, expiry-policy=:"session-end", timeout=0, dynamic=false,
> outcomes=@PN_SYMBOL[:"amqp:accepted:list", :"amqp:rejected:list"]],
> target=@target(41) [address="payments", durable=0,
> expiry-policy=:"session-end", timeout=0, dynamic=false,
> capabilities=@PN_SYMBOL[:topic]], incomplete-unsettled=false,
> initial-delivery-count=0]
> [0x1818ed0]:1 -> @attach(18)
> [name="qpid-jms:sender:ID:POMALLASSI-59817-1449570029482-0:1:1:1:payments",
> handle=0, role=true, snd-settle-mode=2, rcv-settle-mode=0,
> source=@source(40) [address="ID:POMALLASSI-59817-1449570029482-0:1:1:1",
> durable=0, timeout=0, dynamic=false,
> outcomes=@PN_SYMBOL[:"amqp:accepted:list", :"amqp:rejected:list"]],
> target=@target(41) [address="payments", durable=0, timeout=0,
> dynamic=false, capabilities=@PN_SYMBOL[:topic]], initial-delivery-count=0]
> [0x1818ed0]:1 -> @flow(19) [next-incoming-id=1, incoming-window=15,
> next-outgoing-id=0, outgoing-window=2147483647, handle=0, delivery-count=0,
> link-credit=1000, drain=false]
> [0x1818ed0]:1 <- @transfer(20) [handle=0, delivery-id=0, delivery-tag=b"0",
> message-format=0] (221)
> "\x00Sp\xc0\x02\x01A\x00Sr\xc1D\x06\xa3\x12x-opt-jms-msg-typeQ\x05\xa3\x18x-opt-app-correlation-idA\xa3\x0ex-opt-jms-destQ\x01\x00Ss\xc0X\x0a\xa1+ID:POMALLASSI-59817-1449570029482-0:1:1:1-1@
> \xa1\x08payments\xa1\x0bpayments.ok@\xa1\x03abc@@@\x83\x00\x00\x01Q\x81\x1bR7\x00St\xc1\x1b\x04\xa1\x06weightq\x00\x00\x0a(\xa1\x05color\xa1\x04blue\x00Sw\xa1\x0bHello
> World"
> [0x1818ed0]:1 -> @flow(19) [next-incoming-id=2, incoming-window=15,
> next-outgoing-id=0, outgoing-window=2147483647, handle=0, delivery-count=1,
> link-credit=1000, drain=false]
> [0x1818ed0]:1 -> @disposition(21) [role=true, first=0, last=0,
> settled=true, state=@modified(39) [delivery-failed=false,
> undeliverable-here=true]]
>

>From the logs above you can see that the router recieves a message,
but then sends a disposition update for it back to the client to
indicate that it is undeliverable. This is presumably because the
router believes it has nowhere to send it (more on this below).


>
>
> Tue Dec  8 11:06:53 2015 SERVER (debug) Accepting incoming connection from
> 192.168.56.102:59820 to 192.168.56.103:20000
> (/home/omallassi/qpid-dispatch-0.5/src/server.c:231)
> Tue Dec  8 11:06:53 2015 MESSAGE (trace) Received Message{to='payments'
> body='\a1'} on link
> qpid-jms:sender:ID:POMALLASSI-59817-1449570029482-0:1:1:1:payments
> (/home/omallassi/qpid-dispatch-0.5/src/message.c:721)
>
>
> So it looks like the router received the message with the address payments
> (which is my topic name I am publishing to)
>
> Yet, on the broker side, no FRM / RAW message. so the broker does not
> receive any messages from the router.
>
>
> my router config defined as follow
> router & connector info etc..
> waypoint {
>     address: payments
>     out-phase: 1
>     in-phase: 0
>     connector: broker1
> }
>
> fixedAddress {
>     prefix: payment
>     phase: 0
>     fanout: single
>     bias: spread
> }
>
>
> for sure my target address is not good but can someone help me
> understanding this. When my JMS client publish, can it publish to a topic
> and this is transform in an address like amqp://brokerip/payments? Do I
> need to publish to address that respect the _topo/area/...I have to say
> this part is quite blur...
>
>
>
> ------------------------------------------------------------------------
> @Keith and regarding the connection between the router and the Java broker, I
> quickly tested the same config on version 6.0.0 w/o success.
>
> *on broker side*
> 2015-12-08 09:59:55,586 DEBUG [IO-/192.168.56.103:52422] (FRM) -
> SEND[/192.168.56.103:52422|0] : SaslOutcome{code=ok}
> 2015-12-08 09:59:57,589 INFO  [IO-/192.168.56.103:52422] *(q.m.c.idle_close)
> - [con:34(/192.168.56.103:52422 <http://192.168.56.103:52422>)] CON-1003 :
> Closed due to inactivity*
> *2015-12-08 09:59:57,590 DEBUG [IO-/192.168.56.103:52422
> <http://192.168.56.103:52422>] (FRM) - RECV[/192.168.56.103:52422|-1] :
> Underlying connection closed*
> 2015-12-08 10:00:02,598 DEBUG [IO-/192.168.56.103:52423] (FRM) -
> SEND[/192.168.56.103:52423|0] :
> SaslMechanisms{saslServerMechanisms=[ANONYMOUS]}
> 2015-12-08 10:00:02,599 DEBUG [IO-/192.168.56.103:52423] (FRM) -
> RECV[/192.168.56.103:52423|0] :
> SaslInit{mechanism=ANONYMOUS,initialResponse=anonymous}
>
> *on router side *
>
> Connected to 192.168.56.103:10002
> [0x7ff65400a530]:  -> SASL
> [0x7ff65400a530]:0 -> @sasl-init(65) [mechanism=:ANONYMOUS,
> initial-response=b"anonymous"]
> [0x7ff65400a530]:  -> AMQP
> [0x7ff65400a530]:0 -> @open(16) [container-id="qpid.dispatch.router.A",
> max-frame-size=65536, channel-max=32767,
> offered-capabilities=:"ANONYMOUS-RELAY",
> properties={:product="qpid-dispatch-router", :version="0.5"}]
> [0x7ff65400a530]:  <- SASL
> [0x7ff65400a530]:0 <- @sasl-mechanisms(64)
> [sasl-server-mechanisms=@PN_SYMBOL[:ANONYMOUS]]
> [0x7ff65400a530]:0 <- @sasl-outcome(68) [code=0]
> [0x7ff65400a530]:  <- AMQP
> [0x7ff65400a530]:0 -> @close(24) [error=@error(29)
> *[condition=:"amqp:connection:framing-error",
> description="connection aborted"]]*
> [0x7ff65400a530]:  <- EOS
> [0x7ff65400a530]:  -> EOS
>
>
>
> *and then on the router log *
>
> Tue Dec  8 10:00:02 2015 SERVER (trace) Connecting to 192.168.56.103:10002
> (/home/omallassi/qpid-dispatch-0.5/src/server.c:816)
> Tue Dec  8 10:00:04 2015 SERVER (trace) Connection to 192.168.56.103:10002
> failed (/home/omallassi/qpid-dispatch-0.5/src/server.c:438)
>
> I should have mis-configured something.
> I did not investigate more than that (I need to focus on the dispatch /
> broker integration) but let me know if you want me to try some tests
>

The above is presumably why the router couldnt do anything with the
message sent by the client. It seems to indicate that the connection
never fully opened and then aborted. You can see the SASL steps
complete successfully on the broker (outcome code of 0), but the
broker does not then send an Open frame after its AMQP header.

It seems from the other logging that there are 2 seconds across the
connection attempt and failure. I believe the Java broker has a
timeout after which it will kill connections that initiate but dont
complete negotation, so perhaps that might be in play. The router
appears to be pipelining its SASL and AMQP Open frames before the
broker sends anything, so one possibility might be that the broker
doesnt like that, another could be that there is something awry with
the Open frame but nothing jumps out at me from the logging.

>
>
>
>
> On Tue, Dec 8, 2015 at 12:15 AM, Keith W <keith.wall@gmail.com> wrote:
>
>> Hi Olivier
>>
>> For the Java Broker, you are correct that it defaults to a
>> PlainPasswordProvider assigned to the AMQP port, so it will fail unless you
>> have the client authenticate.  If you didn't change this already, then I
>> would have expected your first experiment (AMQP client direct to Java
>> Broker) to fail.   To set up the anonymous provider, you need to create the
>> anonymous authentication provider AND assign it to the AMQP port.  You can
>> do these both through the UI.  You'll then need to restart the Broker to
>> have the changes picked up.
>>
>> To turn on logging for the AMQP 1.0 in the Java Broker, you need to enable
>> the loggers called simply FRM (the frame level logging)  and RAW (for the
>> bytes).  You don't mention which version of the Java Broker you use.  If
>> you are on 0.32 and below, you need to add these loggers to the
>> etc/log4j.xml file at level DEBUG.   If you are testing the 6.0.0 release
>> candidate you can enabled logging of FRM and RAW through the Web Management
>> Console.  Just add a new Log Inclusion Rule for both at level DEBUG.
>>
>> Let us know what you see.
>>
>> Keith.
>>
>> On 7 December 2015 at 19:54, Ted Ross <tross@redhat.com> wrote:
>>
>> > You should turn on the proton trace for the router to get more detailed
>> > information about what is happening.  To get even more detailed, you can
>> > use tcpdump to get a trace of the communication.
>> >
>> >     PN_TRACE_FRM=1 qdrouterd ...
>> >
>> > -Ted
>> >
>> >
>> > On 12/07/2015 02:40 PM, Olivier Mallassi wrote:
>> >
>> >> Hello everybody,
>> >>
>> >> I am facing an issue while (attempting to connect the router and a java
>> >> broker)
>> >>
>> >> - I have a JMS client *successfully* publishing to the Java broker (AMQP
>> >> 1.0) w/ the following url
>> >>
>> >> env.put("connectionfactory.qpidConnectionfactory", "amqp://
>> >> 192.168.56.103:10000?clientid=test-client&remote-host=default");
>> >>
>> >>
>> >> - then I want to "put" a router between and have a simple topology JMS
>> >> client -> router -> Java Broker
>> >>
>> >> Based on different links (
>> >>
>> >>
>> http://qpid.2158936.n2.nabble.com/Dispatch-Router-distributed-topics-td7611684.html#a7611710
>> >> ,
>> >>
>> >>
>> http://qpid.2158936.n2.nabble.com/Dispatch-Router-distributed-topics-td7611684.html#a7611710
>> >> ,
>> >> https://issues.apache.org/jira/browse/DISPATCH-126 ) I have ended up
>> with
>> >> the following qdrouter.conf
>> >>
>> >>
>> >> container{
>> >> worker-threads: 4
>> >> containerName: qpid.dispatch.router.A
>> >> }
>> >>
>> >> listener {
>> >> addr: 192.168.56.103
>> >> port: 20000
>> >> saslMechanisms: ANONYMOUS
>> >> requireSsl: no
>> >> authenticatePeer: no
>> >> }
>> >>
>> >> connector {
>> >>      name: broker1
>> >>      role: on-demand
>> >>      addr: 192.168.56.103
>> >>      port: 10000
>> >>      sasl-mechanisms: ANONYMOUS
>> >> }
>> >>
>> >> router {
>> >> mode: standalone
>> >> routerId: router.A
>> >> }
>> >>
>> >>
>> >> waypoint {
>> >> address: payments
>> >> in-phase: 0
>> >> out-phase: 1
>> >> connector: broker1
>> >> }
>> >>
>> >> waypoint {
>> >> address: instruction
>> >> in-phase: 0
>> >> out-phase: 1
>> >> connector: broker1
>> >> }
>> >>
>> >> fixed-address {
>> >>      prefix: instruction
>> >>      phase: 0
>> >>      fanout: single
>> >>      bias: spread
>> >> }
>> >>
>> >> fixed-address {
>> >>      prefix: instruction
>> >>      phase: 1
>> >>      fanout: single
>> >>      bias: closest
>> >> }
>> >>
>> >>
>> >> log {
>> >> module: DEFAULT
>> >> enable: trace+
>> >> source: true
>> >> output: /tmp/router.A.log
>> >> }
>> >>
>> >>
>> >> Yet, while starting the qdrouter, I see the different entities creation
>> >> but
>> >> at the end, I got
>> >>
>> >> Mon Dec  7 18:29:51 2015 SERVER (trace) Connecting to
>> >> 192.168.56.103:10000
>> >> (/home/omallassi/qpid-dispatch-0.5/src/server.c:816)
>> >> Mon Dec  7 18:29:51 2015 SERVER (trace) Connection to
>> >> 192.168.56.103:10000
>> >> failed (/home/omallassi/qpid-dispatch-0.5/src/server.c:438)
>> >> Mon Dec  7 18:29:56 2015 SERVER (trace) Connecting to
>> >> 192.168.56.103:10000
>> >> (/home/omallassi/qpid-dispatch-0.5/src/server.c:816)
>> >> Mon Dec  7 18:29:56 2015 SERVER (trace) Connection to
>> >> 192.168.56.103:10000
>> >> failed (/home/omallassi/qpid-dispatch-0.5/src/server.c:438)
>> >> Mon Dec  7 18:30:01 2015 SERVER (trace) Connecting to
>> >> 192.168.56.103:10000
>> >> (/home/omallassi/qpid-dispatch-0.5/src/server.c:816)
>> >> Mon Dec  7 18:30:01 2015 SERVER (trace) Connection to
>> >> 192.168.56.103:10000
>> >> failed (/home/omallassi/qpid-dispatch-0.5/src/server.c:438)
>> >>
>> >> on the broker side (Log level debug) no logs.
>> >>
>> >>
>> >> I thought it was because the Java Broker has a default
>> >> authenticationProvider to PlainPasswordFile. I configured the Java
>> Broker
>> >> w/ anonymous authenticationProvider but got the same error.
>> >>
>> >> Do you have any idea of what's going on? or what kind of test / config I
>> >> can do to better understand the problem.
>> >>
>> >> Thanks a lot.
>> >>
>> >>
>> > ---------------------------------------------------------------------
>> > 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


Mime
View raw message