RabbitMQ closing connection

조회수 1,072회
읽지 않은 첫 메시지로 건너뛰기

vishal gaurav

읽지 않음,
2016. 7. 11. 오전 6:46:5016. 7. 11.
받는사람 rabbitmq-users
Hi,

I am trying to connect to rabbitmq using amqp client and looks like rabbitmq is closing the connection forcibly.  I can see the connection is being made and then its terminated. I assume there is some problem in handshake but not able to figure it out.
I have extracted the message from log but not able to decipher it. 

Can someone help me understand this. 

** Reason for termination == 
** {function_clause,
       [{rabbit_amqp1_0_link_util,'-outcomes/1-lc$^0/1-0-',
            [{list,
                 [{symbol,<<"amqp:accepted:list">>},
                  {symbol,<<"amqp:rejected:list">>},
                  {symbol,<<"amqp:released:list">>},
                  {symbol,<<"amqp:modified:list">>}]}],
            [{file,"src/rabbit_amqp1_0_link_util.erl"},{line,49}]},
        {rabbit_amqp1_0_link_util,outcomes,1,
            [{file,"src/rabbit_amqp1_0_link_util.erl"},{line,49}]},
        {rabbit_amqp1_0_outgoing_link,attach,3,
            [{file,"src/rabbit_amqp1_0_outgoing_link.erl"},{line,41}]},
        {rabbit_amqp1_0_session_process,with_disposable_channel,2,
            [{file,"src/rabbit_amqp1_0_session_process.erl"},{line,377}]},
        {rabbit_amqp1_0_session_process,handle_control,2,
            [{file,"src/rabbit_amqp1_0_session_process.erl"},{line,197}]},
        {rabbit_amqp1_0_session_process,handle_cast,2,
            [{file,"src/rabbit_amqp1_0_session_process.erl"},{line,134}]},
        {gen_server2,handle_msg,2,[{file,"src/gen_server2.erl"},{line,1049}]},
        {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,240}]}]}
=ERROR REPORT==== 8-Jul-2016::17:09:27 ===
closing AMQP connection <0.29082.0> (127.0.0.1:55479 -> 127.0.0.1:5672):
{handshake_error,running,<0.29104.0>,
    {{symbol,<<"amqp:internal-error">>},
     "Session error: ~p~n~p~n",
     [function_clause,
      [{rabbit_amqp1_0_link_util,'-outcomes/1-lc$^0/1-0-',
           [{list,
                [{symbol,<<"amqp:accepted:list">>},
                 {symbol,<<"amqp:rejected:list">>},
                 {symbol,<<"amqp:released:list">>},
                 {symbol,<<"amqp:modified:list">>}]}],
           [{file,"src/rabbit_amqp1_0_link_util.erl"},{line,49}]},
       {rabbit_amqp1_0_link_util,outcomes,1,
           [{file,"src/rabbit_amqp1_0_link_util.erl"},{line,49}]},
       {rabbit_amqp1_0_outgoing_link,attach,3,
           [{file,"src/rabbit_amqp1_0_outgoing_link.erl"},{line,41}]},
       {rabbit_amqp1_0_session_process,with_disposable_channel,2,
           [{file,"src/rabbit_amqp1_0_session_process.erl"},{line,377}]},
       {rabbit_amqp1_0_session_process,handle_control,2,
           [{file,"src/rabbit_amqp1_0_session_process.erl"},{line,197}]},
       {rabbit_amqp1_0_session_process,handle_cast,2,
           [{file,"src/rabbit_amqp1_0_session_process.erl"},{line,134}]},
       {gen_server2,handle_msg,2,[{file,"src/gen_server2.erl"},{line,1049}]},
       {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,240}]}]]}}

Jean-Sébastien Pédron

읽지 않음,
2016. 7. 11. 오전 8:41:5816. 7. 11.
받는사람 rabbitm...@googlegroups.com
On 11/07/2016 12:46, vishal gaurav wrote:
> Hi,

Hi!

> I am trying to connect to rabbitmq using amqp client and looks like
> rabbitmq is closing the connection forcibly. I can see the connection
> is being made and then its terminated. I assume there is some problem in
> handshake but not able to figure it out.

Could you please indicate which version of RabbitMQ you are using, and
which AMQP client?

--
Jean-Sébastien Pédron
Pivotal / RabbitMQ

vishal gaurav

읽지 않음,
2016. 7. 11. 오전 9:21:0116. 7. 11.
받는사람 rabbitmq-users, jean-se...@rabbitmq.com
Thanks for your reply.

I am using rabbitmq 3.6.2 and using apche qpid library (used indirectly by camel -amqp)  with amqp 1.0 protocol.

Thanks
-Vishal

vishal gaurav

읽지 않음,
2016. 7. 11. 오전 9:25:4616. 7. 11.
받는사람 rabbitmq-users, jean-se...@rabbitmq.com
Also qpid jms client 0.8.0 ( camel version 2.17.1)

Jean-Sébastien Pédron

읽지 않음,
2016. 7. 11. 오전 9:26:3316. 7. 11.
받는사람 rabbitm...@googlegroups.com
On 11/07/2016 15:21, vishal gaurav wrote:
> I am using rabbitmq 3.6.2 and using apche qpid library (used indirectly
> by camel -amqp) with amqp 1.0 protocol.

Maybe there is a bug in our AMQP 1.0 plugin. Could you please share a
small code sample to reproduce the problem?

vishal gaurav

읽지 않음,
2016. 7. 11. 오전 10:29:1516. 7. 11.
받는사람 rabbitmq-users, jean-se...@rabbitmq.com
Hi,

Here is the sample code which I have tested using qpid 0.8

import org.apache.qpid.jms.JmsConnectionFactory;

import javax.jms.*;
import java.io.InputStream;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

/**
 * Created by VISHAL on 11-07-2016.
 */
public class RabbitMQTest {

   
public static void main(String[] args) {
       
RabbitMQTest test = new RabbitMQTest();
        test
.runTest();
   
}

   
private void runTest() {
       
try (InputStream propertiesStream = getClass().getResourceAsStream("/application.properties")) {

           
JmsConnectionFactory connectionFactory = new JmsConnectionFactory("guest", "guest", "amqp://127.0.0.1:5672");

           
Connection connection = connectionFactory.createConnection();
           
Session producersession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
           
Queue queue = new Queue() {
               
@Override
                public String getQueueName() throws JMSException {
                   
return "testQueue2";
               
}
           
};

           
Session consumerSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
           
MessageConsumer messageConsumer = consumerSession.createConsumer(queue);

           
final CountDownLatch latch = new CountDownLatch(1);
            messageConsumer
.setMessageListener(new MessageListener() {
               
public void onMessage(final Message message) {
                   
try {
                       
if (message instanceof TextMessage) {
                           
System.out.println(((TextMessage) message).getText());
                       
} else {
                           
System.out.println("Received enexpected message type: " + message.getClass().getName());
                       
}

                       
latch.countDown();
                   
} catch (JMSException e) {
                       
System.out.println("Caught exception in onMessage(): " + e.getMessage());
                   
}
               
}
           
});

            connection
.start();

           
MessageProducer messageProducer = producersession.createProducer(queue);
           
TextMessage message = producersession.createTextMessage("Hello world!");

            messageProducer
.send(message);

           
int delay = 5;
           
if (!latch.await(delay, TimeUnit.SECONDS)) {
               
System.out.println("Waited " + delay + "sec but no message recieved.");
           
}

            connection
.close();
       
} catch (
               
Exception exp
               
)

       
{
           
System.out.println("Caught exception: " + exp.getMessage());
            exp
.printStackTrace();
       
}
   
}
}

vishal gaurav

읽지 않음,
2016. 7. 26. 오전 9:44:0616. 7. 26.
받는사람 rabbitmq-users, jean-se...@rabbitmq.com
Hi Jean,

Is it a bug or should I look for some alternative solution.

Thanks
-Vishal

Michael Klishin

읽지 않음,
2016. 7. 27. 오전 3:32:5216. 7. 27.
받는사람 rabbitm...@googlegroups.com, Jean-Sébastien Pédron
What is in server logs around the time the disconnection happens?

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ

vishal gaurav

읽지 않음,
2016. 7. 27. 오전 3:36:3116. 7. 27.
받는사람 rabbitmq-users, jean-se...@rabbitmq.com
Hi,

The portion of log was posted in start of the thread. For your reference here it is again :

Michael Klishin

읽지 않음,
2016. 7. 27. 오전 3:56:5916. 7. 27.
받는사람 rabbitm...@googlegroups.com, Jean-Sébastien Pédron
See https://github.com/rabbitmq/rabbitmq-amqp1.0/issues/31. I'm attaching a one-off build
of the plugin with a proposed fix. Replace the AMQP 1.0 plugin file with it in the server's plugins directory
(note: the file in released versions will have a version in the name).


rabbitmq_amqp1_0-issue31.ez

Dinesh Khandelwal

읽지 않음,
2017. 5. 12. 오전 11:01:4717. 5. 12.
받는사람 rabbitmq-users, jean-se...@rabbitmq.com
I still have the same issue with rabbitmq 3.6.9. 
It is in the log:

{'v1_0.error',{symbol,<<"amqp:not-implemented">>},
              {utf8,<<"Outcomes not supported: [{symbol,<<\"amqp:modified:list\">>}]">>},
              undefined}

Michael Klishin

읽지 않음,
2017. 5. 12. 오전 11:14:4117. 5. 12.
받는사람 rabbitm...@googlegroups.com
Hi Dinesh,

How can it be reproduced? It's not necessarily the same issue even if it looks very similar.

Dinesh Khandelwal

읽지 않음,
2017. 5. 13. 오전 1:26:3017. 5. 13.
받는사람 rabbitmq-users
I am using rabbitmq 3.6.9 with apche qpid 0.8 library (camel-amqp) and amqp 1.0 protocol.
 
I am using the same code as posted above to test the functionality:
After running above code, below error in the RabbitMq log:

=INFO REPORT==== 13-May-2017::10:49:54 ===
accepting AMQP connection
<0.799.0> (127.0.0.1:51879 -> 127.0.0.1:5672)


=WARNING REPORT==== 13-May-2017::10:49:54 ===
Closing session for connection <0.799.0>:

4integ...@gmail.com

읽지 않음,
2017. 8. 2. 오전 9:29:0217. 8. 2.
받는사람 rabbitmq-users
A followup in this thread...

I got the same error when testing on RabbitMQ 3.6.10 with qpid-jms-client v0.23.0 (AMQP 1.0).

No error in test application but hangs on:
MessageProducer sender = session.createProducer(queue);

In server logs:
=INFO REPORT==== 2-Aug-2017::13:24:16 ===
accepting AMQP connection <0.2055.0> (10.0.2.2:57459 -> 172.17.0.2:5672)

=WARNING REPORT==== 2-Aug-2017::13:24:16 ===
Closing session for connection <0.2055.0>:
{'v1_0.error',{symbol,<<"amqp:not-implemented">>},
              {utf8,<<"Outcomes not supported: [{symbol,<<\"amqp:modified:list\">>}]">>},
              undefined}

=WARNING REPORT==== 2-Aug-2017::13:24:27 ===
closing AMQP connection <0.2055.0> (10.0.2.2:57459 -> 172.17.0.2:5672):
client unexpectedly closed TCP connection


Full application:

package com.myself.test;

import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
import javax.jms.Queue;
import javax.jms.Session;
import javax.jms.TextMessage;

import org.apache.qpid.jms.JmsConnectionFactory;

public class AmqpJmsSenderApp {

	public static void main(String[] args) throws Exception {
		Connection connection = null;
		ConnectionFactory connectionFactory = new JmsConnectionFactory("amqp://localhost:30000");

		try {

			// Step 1. Create an amqp qpid 1.0 connection
			connection = connectionFactory.createConnection("admin", "pass");

			// Step 2. Create a session
			Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

			// Step 3. Create a sender
			Queue queue = session.createQueue("/amq/queue/CRM.TEST.QUEUE");
			MessageProducer sender = session.createProducer(queue);

			// Step 4. send a few simple message
			sender.send(session.createTextMessage("Hello world "));

			connection.start();

			// Step 5. create a moving receiver, this means the message will be
			// removed from the queue
			MessageConsumer consumer = session.createConsumer(queue);

			// Step 7. receive the simple message
			TextMessage m = (TextMessage) consumer.receive(5000);
			System.out.println("message = " + m.getText());

		} finally {
			if (connection != null) {
				// Step 9. close the connection
				connection.close();
			}
		}
	}
}



/ Joacim

Michael Klishin

읽지 않음,
2017. 8. 2. 오전 10:55:1417. 8. 2.
받는사람 rabbitm...@googlegroups.com
amqp:modified:list is not currently supported by the plugin. As far as I can see,
our test suite confirms this.

To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

4integ...@gmail.com

읽지 않음,
2017. 8. 10. 오전 9:50:5317. 8. 10.
받는사람 rabbitmq-users
Hi,

Do you have any plans to implement "amqp:modified:list"?

/ Joacim

Michael Klishin

읽지 않음,
2017. 8. 10. 오전 9:54:1117. 8. 10.
받는사람 rabbitm...@googlegroups.com
We'd like to but there is no ETA. Feel free to file an issue about that
for the plugin on GitHub.

To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
전체답장
작성자에게 답글
전달
새 메시지 0개