SpringBoot 2.1.3 Qpid client(6.3.3) high cpu when broker shutdown

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

SpringBoot 2.1.3 Qpid client(6.3.3) high cpu when broker shutdown

lizzrd
I have a Springboot 2.1.3 application that is using Qpid client 6.3.3 to
connect to a qpid broker.  This is a receiving application that uses a
"org.springframework.jms.listener.DefaultMessageListenerContainer" with
ConcurrentConsumers set to 5.  Whenever I shutdown the broker,  the cpu on
the client climbs to 100%.  We I restart the broker the application does not
reconnect.

If I replace the 6.3.3 Qpid client with version 0.32, the application
behaves as expected. Loop every 5 seconds trying to reconnect and with
resume with the broker is brought online.

If I use 6.3.3 Qpid client with 1 ConcurrentConsumers, it seems to behave in
a way I would expect.

I have tried other version of Qpid Client, it seems anything newer than 0.32
has the same behavior.

It there something I am missing?  



--
Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: SpringBoot 2.1.3 Qpid client(6.3.3) high cpu when broker shutdown

Gordon Sim
On 06/03/2019 11:40 pm, lizzrd wrote:

> I have a Springboot 2.1.3 application that is using Qpid client 6.3.3 to
> connect to a qpid broker.  This is a receiving application that uses a
> "org.springframework.jms.listener.DefaultMessageListenerContainer" with
> ConcurrentConsumers set to 5.  Whenever I shutdown the broker,  the cpu on
> the client climbs to 100%.  We I restart the broker the application does not
> reconnect.
>
> If I replace the 6.3.3 Qpid client with version 0.32, the application
> behaves as expected. Loop every 5 seconds trying to reconnect and with
> resume with the broker is brought online.
>
> If I use 6.3.3 Qpid client with 1 ConcurrentConsumers, it seems to behave in
> a way I would expect.
>
> I have tried other version of Qpid Client, it seems anything newer than 0.32
> has the same behavior.
>
> It there something I am missing?

There are two entirely different JMS clients. One is the AMQP 1.0
version and is the one I would recommend:
https://qpid.apache.org/components/jms/index.html. The latest version of
that is 0.40.0

The other supports older, pre-1.0 versions of AMQP. I would only use
this if you have a specific need to use one of the older protocols. Both
qpid brokers support and encourage AMQP 1.0 now. This client is at
version 6.3.3: https://qpid.apache.org/components/jms/amqp-0-x.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: SpringBoot 2.1.3 Qpid client(6.3.3) high cpu when broker shutdown

lizzrd
Thank you Gordon.  I will use your advice and use QPID JMS 0.40.0 with JMS
2.0 API and AMPQ 1.0.  This version works the way I expected and handles
more than one ConcurrentConsumer

For any one working on QPID client 6.3.3.  I did not find any issues with
version 6.0.0 - 6.0.6.  The high CPU issue where a
DefaultMessageListenerContainer has more than one ConcurrentConsumer appears
in version 6.0.7 - 6.3.3.  While I did not test every  version, I did spot
check quite a few.




--
Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: SpringBoot 2.1.3 Qpid client(6.3.3) high cpu when broker shutdown

Oleksandr Rudyy
Hi Tim,
Thanks for tracking this issue to version 6.0.7.

I will try to reproduce your issue over weekend to understand what exactly
happens on broker bounce. Do you use cpp  or java broker?

On Thu, 7 Mar 2019 at 19:44, lizzrd <[hidden email]> wrote:

> Thank you Gordon.  I will use your advice and use QPID JMS 0.40.0 with JMS
> 2.0 API and AMPQ 1.0.  This version works the way I expected and handles
> more than one ConcurrentConsumer
>
> For any one working on QPID client 6.3.3.  I did not find any issues with
> version 6.0.0 - 6.0.6.  The high CPU issue where a
> DefaultMessageListenerContainer has more than one ConcurrentConsumer
> appears
> in version 6.0.7 - 6.3.3.  While I did not test every  version, I did spot
> check quite a few.
>
>
>
>
> --
> Sent from:
> http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: SpringBoot 2.1.3 Qpid client(6.3.3) high cpu when broker shutdown

lizzrd
Oleksandr,

I am using qpidd (qpid-cpp) version 1.35.0 which is docker
fedora/qpid:latest.
The setup to produce the behavior is fairly simple.

import org.apache.qpid.client.AMQConnectionFactory;
import org.apache.qpid.url.URLSyntaxException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jms.listener.DefaultMessageListenerContainer;
import org.springframework.jms.listener.adapter.MessageListenerAdapter;
import org.springframework.util.ErrorHandler;

@Configuration
public class AmqpConfig
{
    private static Logger logger =
LoggerFactory.getLogger(AmqpConfig.class);

    @Bean
    AMQConnectionFactory connectionFactory() throws URLSyntaxException {
        AMQConnectionFactory connectionfactory = new AMQConnectionFactory();
       
connectionfactory.setConnectionURLString("amqp://guest:guest@127.0.0.1:5672/?brokerlist='tcp://127.0.0.1:5672'");
        return connectionfactory;
    }

    @Bean
    DefaultMessageListenerContainer container() throws URLSyntaxException {
        final DefaultMessageListenerContainer container = new
DefaultMessageListenerContainer();
        container.setAutoStartup(true);
        container.setConnectionFactory(connectionFactory());
        container.setDestinationName("QueueName");
        container.setConcurrentConsumers(5);
        container.setErrorHandler(jmsErrorHandler());
        return container;
    }

    @Bean
    public void readit() {
        try {
            container().setupMessageListener(new MessageListenerAdapter() {
                public void handleMessage(byte[] byteArray) {
                    logger.info("Plain Handler");
                }
            });
        } catch (URLSyntaxException e) {
            e.printStackTrace();
        }
    }

    @Bean
    ErrorHandler jmsErrorHandler(){
        ErrorHandler jmsErrorHandler = new JmsErrorHandler();
        return jmsErrorHandler;
    }
}

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.ErrorHandler;

public class JmsErrorHandler implements ErrorHandler {
    private static Logger log =
LoggerFactory.getLogger(JmsErrorHandler.class);

    public void handleError(final Throwable e) {
        log.info("  Exception == " + e.getMessage());
        e.printStackTrace();
    }
}



--
Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]