Re: Deadlock when using amqp-1-0 client to connect to amqp-0-9-1 broker

2013-12-06 Thread Pavel Moravec
Hi Brian,
let raise it in upstream JIRA: https://issues.apache.org/jira/browse/QPID

Kind regards,
Pavel Moravec


- Original Message -
> From: "Brian" 
> To: users@qpid.apache.org
> Sent: Friday, December 6, 2013 3:40:24 AM
> Subject: Re: Deadlock when using amqp-1-0 client to connect to amqp-0-9-1 
> broker
> 
> I wanted to report it as a bug for development team, but don't know how.
> Anyone can help?
> 
> 
> 
> --
> View this message in context:
> http://qpid.2158936.n2.nabble.com/Deadlock-when-using-amqp-1-0-client-to-connect-to-amqp-0-9-1-broker-tp7601480p7601532.html
> Sent from the Apache Qpid users mailing list archive at Nabble.com.
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
> For additional commands, e-mail: users-h...@qpid.apache.org
> 
> 

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



Re: Deadlock when using amqp-1-0 client to connect to amqp-0-9-1 broker

2013-12-05 Thread Brian
I wanted to report it as a bug for development team, but don't know how.
Anyone can help?



--
View this message in context: 
http://qpid.2158936.n2.nabble.com/Deadlock-when-using-amqp-1-0-client-to-connect-to-amqp-0-9-1-broker-tp7601480p7601532.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

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



Deadlock when using amqp-1-0 client to connect to amqp-0-9-1 broker

2013-12-05 Thread Brian
Hi QPID,

seemed to me, it is a bug for amqp-1-0 java client version 0.24.

I expect when amqp-1-0 client connects to amqp-0-9-1-enable broker, client
should be able to close connection because it supports amqp-1-0 only.

Actually, client could not close connection and run into deadlock because
when it sends frames for protocol handshake, on broker side broker does not
support amqp-1-0, sends back its supported version and closes TCP
connection. An unhandled exception occurs at client that causes client wait
forever.

tracelog:
SEND[localhost/127.0.0.1:5672] : AMQP\x03\x01\x00\x00
RECV [localhost/127.0.0.1:5672] : AMQP\x00\x00\x09\x01
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at 
org.apache.qpid.amqp_1_0.client.Connection.doRead(Connection.java:388)
at 
org.apache.qpid.amqp_1_0.client.Connection.access$1(Connection.java:379)
at org.apache.qpid.amqp_1_0.client.Connection$2.run(Connection.java:259)
at java.lang.Thread.run(Unknown Source)

Program to test as below

import org.apache.qpid.amqp_1_0.transport.Container;
import org.apache.qpid.amqp_1_0.type.UnsignedInteger;

public class Consumer {

private static Container container = new Container();
private static String host = "localhost";
private static String remotehost = "localhost";
private static int port = 5672;
private static String username = "guest";
private static String password = "guest";
private static boolean ssl = false;

private static String queueName = "queue";

public static void main(String[] args) {
Consumer consumer = new Consumer();
consumer.receive();
}

public void receive() {
try {
Connection conn = new Connection(host, port, username, 
password, 65536,
container, remotehost, ssl, -1);
Session session = conn.createSession();
Receiver r = session.createReceiver(queueName, 
AcknowledgeMode.ALO, null,
true, null, null);
r.setCredit(UnsignedInteger.valueOf(100), false);

for (;;) {
Message m = r.receive(1L);
if (m == null) {
break;
}
r.acknowledgeAll(m);
System.out.println("Received Message : " + 
m.getPayload());
}
r.close();
r.getSession().close();
r.getSession().getConnection().close();
} catch (ConnectionException e) {
e.printStackTrace();
}
}
}



--
View this message in context: 
http://qpid.2158936.n2.nabble.com/Deadlock-when-using-amqp-1-0-client-to-connect-to-amqp-0-9-1-broker-tp7601480.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

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