Using ActiveMQ appears an strange exception - "Pool not open"

2018-03-20 Thread Chester_Zheng
Hello you guys,I'm using ActiveMQ for a couple of months. But It works a
little bit bad recently."The Strange Exception" is that "Pool not open".
This exception appear by my custom producer.I use "PooledConnectionFactory"
to create a connection, and then create a session.Does any brother meet this
kind of problem? Looking forward to helping.Thanks a
lot.javax.jms.IllegalStateException: java.lang.IllegalStateException: Pool
not openat
org.apache.activemq.jms.pool.ConnectionPool.createSession(ConnectionPool.java:162)
at
org.apache.activemq.jms.pool.PooledConnection.createSession(PooledConnection.java:167)
at
com.bs.pid.link.pc.activemq.util.SendMessageUtil.sendTextMessage(SendMessageUtil.java:55)
at
com.bs.pid.link.pc.service.impl.EtermBigDispatchFacadeImpl.sendCmd(EtermBigDispatchFacadeImpl.java:137)
at
com.bs.pid.link.pc.service.impl.EtermBigDispatchFacadeImpl$$FastClassBySpringCGLIB$$2d0dcbbe.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:708)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at
com.bs.pid.common.utils.trace.MdcTraceIdMethodInterceptor.invoke(MdcTraceIdMethodInterceptor.java:26)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at
org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:644)



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

javax.jms.JMSException: Error while attempting to add new Connection to the pool

2018-01-11 Thread Chester_Zheng
I meet the following error,it happens when the application is running period
time later. If I restart the application, it will be ok. Does any one meet
the problem like this? Please, Help me.The xxx.xxx.xxx.xxx.ActiveMQPublisher
is made by me to establish a connection to send msg to ActiveMQ.Thanks a
lot!!![ERROR]xxx.xxx.xxx.xxx.ActiveMQPublisher-Error while attempting to add
new Connection to the pooljavax.jms.JMSException: Error while attempting to
add new Connection to the pool  at
org.apache.activemq.jms.pool.PooledConnectionFactory.createJmsException(PooledConnectionFactory.java:266)
at
org.apache.activemq.jms.pool.PooledConnectionFactory.createConnection(PooledConnectionFactory.java:225)
at
org.apache.activemq.jms.pool.PooledConnectionFactory.createConnection(PooledConnectionFactory.java:204)
at
com.bs.pid.facade.log.activemq.p2p.ActiveMQPublisher.sendTextMessage(ActiveMQPublisher.java:203)
at
com.bs.pid.facade.log.thread.PersistLogRunnable.run(PersistLogRunnable.java:39)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)Caused by:
java.lang.NullPointerException: nullat
org.apache.activemq.jms.pool.PooledConnectionFactory.createConnection(PooledConnectionFactory.java:223)
... 6 common frames omitted



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: Re: o.s.jms.listener.DefaultMessageListenerContainer-Number of scheduled consumers has dropped below concurrentConsumers limit, probably due to tasks having been rejected. Check your thread pool c

2017-06-09 Thread Chester_Zheng
hi, Tim

Thanks for ur suggestion.



chester_zh...@sina.com
 
From: Tim Bain [via ActiveMQ]
Date: 2017-06-07 20:50
To: Chester_Zheng
Subject: Re: o.s.jms.listener.DefaultMessageListenerContainer-Number of 
scheduled consumers has dropped below concurrentConsumers limit, probably due 
to tasks having been rejected. Check your thread pool configuration! Automatic 
recovery to be triggered by remaining consumers.
Does your thread pool allow you to create up to 500 threads? 

This question really doesn't have anything to do with ActiveMQ, so although 
you might get an answer here, I'd strongly suggest that you post it on the 
Spring mailing list and on StackOverflow (since lots of people who know 
Spring hang out there). 

Tim 

On Jun 7, 2017 3:19 AM, "Chester_Zheng" <[hidden email]> wrote: 

> Hi, AllI met a problem. I used the "DefaultMessageListenerContainer" to 
> increase the consumer count, but when the app run awhile, the log shows 
> that 
> "o.s.jms.listener.DefaultMessageListenerContainer-Number of scheduled 
> consumers has dropped below concurrentConsumers limit, probably due to 
> tasks 
> having been rejected. Check your thread pool configuration! Automatic 
> recovery to be triggered by remaining consumers."The XML configuration that 
> I use a single point. No any cluster.The Java code config is 
> following:DefaultMessageListenerContainer defaultMessageListenerContainer 
> = 
> new DefaultMessageListenerContainer(); 
> defaultMessageListenerContainer.setPubSubDomain(true); 
> defaultMessageListenerContainer.setDestination(adminQueue); 
> defaultMessageListenerContainer.setConnectionFactory(connectionFactory); 
> defaultMessageListenerContainer.setPubSubNoLocal(false); 
> defaultMessageListenerContainer.setMessageListener(this); 
> defaultMessageListenerContainer.setSessionAcknowledgeMode( 
> Session.AUTO_ACKNOWLEDGE); 
> defaultMessageListenerContainer.setIdleConsumerLimit(10); 
> defaultMessageListenerContainer.setIdleTaskExecutionLimit(100); 
> defaultMessageListenerContainer.initialize(); 
> defaultMessageListenerContainer.setMaxMessagesPerTask(10); 
> defaultMessageListenerContainer.setConcurrentConsumers(100); 
> defaultMessageListenerContainer.setMaxConcurrentConsumers(500); 
> defaultMessageListenerContainer.start();And for increasing producing and 
> consuming, I made more than 1 message queue. I don't think that making more 
> queues can lead to this problem.How could I solve this problem?Please, Help 
> me.Thanks!!! 
> 
> 
> 
> -- 
> View this message in context: http://activemq.2283324.n4. 
> nabble.com/o-s-jms-listener-DefaultMessageListenerContaine 
> r-Number-of-scheduled-consumers-has-dropped-below-con-tp4727138.html 
> Sent from the ActiveMQ - User mailing list archive at Nabble.com. 




If you reply to this email, your message will be added to the discussion below:
http://activemq.2283324.n4.nabble.com/o-s-jms-listener-DefaultMessageListenerContainer-Number-of-scheduled-consumers-has-dropped-below-con-tp4727138p4727150.html
 
To unsubscribe from o.s.jms.listener.DefaultMessageListenerContainer-Number of 
scheduled consumers has dropped below concurrentConsumers limit, probably due 
to tasks having been rejected. Check your thread pool configuration! Automatic 
recovery to be triggered by remaining consumers., click here.
NAML 




--
View this message in context: 
http://activemq.2283324.n4.nabble.com/o-s-jms-listener-DefaultMessageListenerContainer-Number-of-scheduled-consumers-has-dropped-below-con-tp4727138p4727269.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

o.s.jms.listener.DefaultMessageListenerContainer-Number of scheduled consumers has dropped below concurrentConsumers limit, probably due to tasks having been rejected. Check your thread pool configura

2017-06-07 Thread Chester_Zheng
Hi, AllI met a problem. I used the "DefaultMessageListenerContainer" to
increase the consumer count, but when the app run awhile, the log shows that
"o.s.jms.listener.DefaultMessageListenerContainer-Number of scheduled
consumers has dropped below concurrentConsumers limit, probably due to tasks
having been rejected. Check your thread pool configuration! Automatic
recovery to be triggered by remaining consumers."The XML configuration that
I use a single point. No any cluster.The Java code config is
following:DefaultMessageListenerContainer defaultMessageListenerContainer =
new DefaultMessageListenerContainer();  
defaultMessageListenerContainer.setPubSubDomain(true);  
defaultMessageListenerContainer.setDestination(adminQueue); 
defaultMessageListenerContainer.setConnectionFactory(connectionFactory);

defaultMessageListenerContainer.setPubSubNoLocal(false);
defaultMessageListenerContainer.setMessageListener(this);   
defaultMessageListenerContainer.setSessionAcknowledgeMode(Session.AUTO_ACKNOWLEDGE);

defaultMessageListenerContainer.setIdleConsumerLimit(10);   
defaultMessageListenerContainer.setIdleTaskExecutionLimit(100); 
defaultMessageListenerContainer.initialize();   
defaultMessageListenerContainer.setMaxMessagesPerTask(10);  
defaultMessageListenerContainer.setConcurrentConsumers(100);
defaultMessageListenerContainer.setMaxConcurrentConsumers(500); 
defaultMessageListenerContainer.start();And for increasing producing and
consuming, I made more than 1 message queue. I don't think that making more
queues can lead to this problem.How could I solve this problem?Please, Help
me.Thanks!!!



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/o-s-jms-listener-DefaultMessageListenerContainer-Number-of-scheduled-consumers-has-dropped-below-con-tp4727138.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Re: The connection is already closed

2017-05-03 Thread Chester_Zheng
Hi, Tim

Happy to communicate with u again.

I pasted the exception message on my first message.
It didn't show any detailed or explicit hint.
There's not any valuable info about how to deal with the problem.
No any message is about Brokers.

I only set the value "nested.wireFormat.maxInactivityDuration=3000" on
client, but I don't think it's the reason of that exception because the
Brokers still produce and consume messsages.
If any inactive queue is deleted before I use it, that would be confirm the
queue is not inactive.
I check the exception on the internet, but no-one meet the same problem.

I understand the exception is about *connection*, not the factory.

If the close() method is invoked by the third-party libraries that I invoke,
I think it's definitely hard to find.

Chester




--
View this message in context: 
http://activemq.2283324.n4.nabble.com/ActiveMQ-5-13-4-The-connection-is-already-closed-tp4725268p4725495.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Re: The connection is already closed

2017-05-02 Thread Chester_Zheng
Hi, Tim

First of all, Thanks for your response.

I know the exception message is on the factory, and the close() method is a 
public-method that anywhere can invoke it if it has the factory instance.
I've seen the source code and found the exception message. 
But, I can't understand why ActiveMQ appear this exception without any 
explicitly invoke.
I've used debugger and set a breakpoint on the connection's close() method.
Unfortunately, I still don't meet the exception after that day. I don't know 
how it can reproduce.

I extremely wanna know when ActiveMQ will invoke the close() method implicitly 
or explicitly.

Thanks.

Chester


chester_zh...@sina.com
 
From: Tim Bain [via ActiveMQ]
Date: 2017-05-01 04:20
To: Chester_Zheng
Subject: Re: The connection is already closed
The close() methods you referenced are on the factory, while the error 
message you're getting is about the close() method of the connections 
returned by the factory. 

If you can reproduce the problem in a non-operational environment, attach a 
debugger and set a breakpoint on the connection's close() method to see 
where it's being called. If not, you could use Eclipse's Find References 
feature to look for it. Keep in mind that a try-with-resources calls 
close(), so you may not find the call to close() written out explicitly. 

Tim 

On Apr 27, 2017 8:00 AM, "Chester_Zheng" <[hidden email]> wrote: 

> Hi, Dear All 
> I match a strange problem. We built a master/slave cluster of ActiveMQ by 
> using zookeeper as a registration center. 
> First of all, we use the "CachingConnectionFactory" which get from "Spring" 
> to create the ActiveMQ connection. 
> Then, we establish a custom session pool that it's easy to get a session 
> for 
> the high-concurrency scenarios. 
> 
> Strangely, both of test and pulbic enviornment java code is the same, but I 
> didn't find this problem on own test enviornment. 
> 
> P.S.I did the pressure test on the test-enviornment. 
> 
> Is it my wrong way to use or a real bug of ActiveMQ? When And where the 
> ActiveMQ will invoke the method named "close" by itself? 
> 
> I've already seen the ActiveMQ-source. The "CachingConnectionFactory" is 
> extended "SingleConnectionFactory".And I seen the method named "close". 
> There is a private final field named "closed". And the default value is 
> "false". When somewhere invokes the close method, then the filed "closed" 
> will change to "true". 
> 
> If you guys met similar like what I described, Please let me know. Thanks a 
> lot. 
> 
> Here is the error message: 
> 
> org.apache.activemq.ConnectionClosedException: The connection is already 
> closed 
> at 
> org.apache.activemq.ActiveMQConnection.checkClosed( 
> ActiveMQConnection.java:1477) 
> at 
> org.apache.activemq.ActiveMQConnection.checkClosedOrFailed( 
> ActiveMQConnection.java:1464) 
> at 
> org.apache.activemq.ActiveMQConnection.createSession( 
> ActiveMQConnection.java:323) 
> at 
> org.springframework.jms.connection.SingleConnectionFactory.createSession( 
> SingleConnectionFactory.java:416) 
> at 
> org.springframework.jms.connection.CachingConnectionFactory.getSession( 
> CachingConnectionFactory.java:234) 
> at 
> org.springframework.jms.connection.SingleConnectionFactory$ 
> SharedConnectionInvocationHandler.invoke(SingleConnectionFactory.java:556) 
> at com.sun.proxy.$Proxy16.createSession(Unknown Source) 
> at 
> com.bs.pid.link.dc.activemq.util.SessionFactory$1.run( 
> SessionFactory.java:120) 
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker( 
> ThreadPoolExecutor.java:1145) 
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run( 
> ThreadPoolExecutor.java:615) 
> at java.lang.Thread.run(Thread.java:745) 
> 
> The configuration is : 
> 
> http://activemq.apache.org/schema/core; brokerName="bs" 
> schedulePeriodForDestinationPurge="1"  useShutdownHook="false" 
> dataDirectory="${activemq.data}" 
> splitSystemUsageForProducersConsumers="true" producerSystemUsagePortion=" 
> 50" 
> consumerSystemUsagePortion="50"> 
> 
>  
>  
>
>  
>
>  
>
>  
>inactiveTimoutBeforeGC="3"  producerFlowControl="true" 
> memoryLimit="512mb"> 
> 
>   
> 
>   
>   
> 
>   
>   
> 

Re: ActiveMQ-5.13.4 "The connection is already closed"

2017-04-27 Thread Chester_Zheng
please help me.



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/ActiveMQ-5-13-4-The-connection-is-already-closed-tp4725268p4725275.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


The connection is already closed

2017-04-27 Thread Chester_Zheng
Hi, Dear All
I match a strange problem. We built a master/slave cluster of ActiveMQ by
using zookeeper as a registration center.
First of all, we use the "CachingConnectionFactory" which get from "Spring"
to create the ActiveMQ connection.
Then, we establish a custom session pool that it's easy to get a session for
the high-concurrency scenarios.

Strangely, both of test and pulbic enviornment java code is the same, but I
didn't find this problem on own test enviornment.

P.S.I did the pressure test on the test-enviornment.

Is it my wrong way to use or a real bug of ActiveMQ? When And where the
ActiveMQ will invoke the method named "close" by itself?

I've already seen the ActiveMQ-source. The "CachingConnectionFactory" is
extended "SingleConnectionFactory".And I seen the method named "close".
There is a private final field named "closed". And the default value is
"false". When somewhere invokes the close method, then the filed "closed"
will change to "true". 

If you guys met similar like what I described, Please let me know. Thanks a
lot.

Here is the error message:

org.apache.activemq.ConnectionClosedException: The connection is already
closed
at
org.apache.activemq.ActiveMQConnection.checkClosed(ActiveMQConnection.java:1477)
at
org.apache.activemq.ActiveMQConnection.checkClosedOrFailed(ActiveMQConnection.java:1464)
at
org.apache.activemq.ActiveMQConnection.createSession(ActiveMQConnection.java:323)
at
org.springframework.jms.connection.SingleConnectionFactory.createSession(SingleConnectionFactory.java:416)
at
org.springframework.jms.connection.CachingConnectionFactory.getSession(CachingConnectionFactory.java:234)
at
org.springframework.jms.connection.SingleConnectionFactory$SharedConnectionInvocationHandler.invoke(SingleConnectionFactory.java:556)
at com.sun.proxy.$Proxy16.createSession(Unknown Source)
at
com.bs.pid.link.dc.activemq.util.SessionFactory$1.run(SessionFactory.java:120)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

The configuration is :

http://activemq.apache.org/schema/core; brokerName="bs"
schedulePeriodForDestinationPurge="1"  useShutdownHook="false" 
dataDirectory="${activemq.data}"
splitSystemUsageForProducersConsumers="true" producerSystemUsagePortion="50"
consumerSystemUsagePortion="50">



  

  

  

  
 
 
   
 
 
   
  
 
   
 

   











  


  

















http://www.springframework.org/schema/beans;
class="org.apache.activemq.hooks.SpringContextHook" />




The client URL is :

failover\://(tcp\:/xxx.xxx.xxx.xxx:61616?tcpNoDelay\=true,tcp\://xxx.xxx.xxx.xxx:61616?tcpNoDelay\=true,tcp\://xxx.xxx.xxx.xxx:61616?tcpNoDelay\=true)?nested.wireFormat.maxInactivityDuration\=3000=false\=0\=200\=10\=2\=100\=2\=false\=true






--
View this message in context: 
http://activemq.2283324.n4.nabble.com/The-connection-is-already-closed-tp4725268.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.