You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by "seba.wagner@gmail.com" <se...@gmail.com> on 2015/08/10 11:57:06 UTC

Configuring number of connections/pool for ActiveMQ

Hi all,

I just started to use Tomee and I really like the simplicity that it brings
to my app.

But I have an issue with ActiveMQ

I have set up the queue according to the docs at here:
http://activemq.apache.org/tomee.html

<tomee>
    <Resource id="MyJmsResourceAdapter" type="ActiveMQResourceAdapter">
        BrokerXmlConfig =  broker:(tcp://someHostName:61616)
        ServerUrl       =  vm://localhost
    </Resource>

    <Resource id="MyJmsConnectionFactory" type="javax.jms.ConnectionFactory"
>
        ResourceAdapter = MyJmsResourceAdapter
    </Resource>
</tomee>

I can successfully send message to the queue and check with JConsole the
queue length.
But after sending a couple of messages the I receive an exception like this:
javax.jms.JMSException: No ManagedConnections available within configured
blocking timeout ( 5000 [ms] ) for pool
org.apache.geronimo.connector.outbound.SinglePoolConnectionInterceptor@6581542c
at
org.apache.activemq.ra.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:101)
at
org.apache.activemq.ra.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:67)

I first thought it might be an issue with JConsole blocking the queue or
something. But it also happen when there is no JConsole and I restart all
services from scratch.

There must be some connection pool config et cetera?

Where can I modify the Number of Connections that are pooled and handle
this more gracefully in Tomee?

Thanks for your help,

Sebastian

-- 
Sebastian Wagner
https://twitter.com/#!/dead_lock
seba.wagner@gmail.com



-- 
Sebastian Wagner
https://twitter.com/#!/dead_lock
seba.wagner@gmail.com

Re: Configuring number of connections/pool for ActiveMQ

Posted by "seba.wagner@gmail.com" <se...@gmail.com>.
Thanks Romain,

I think I found what you mean:
http://tomee.apache.org/jmsconnectionfactory-config.html

But I think the actual problem was that I did not close the connection.

In the example at: http://tomee.apache.org/tomcat-activemq.html

There is like a "..." at the end. What is actually missing at the end of
the code block is a:
connection.close();

That fixes my connection problems.

Thanks again,
Sebastian


2015-08-11 2:48 GMT+12:00 Romain Manni-Bucau <rm...@gmail.com>:

> Hi
>
> you can configure the PoolingSupport in the connection  factory to setting
> PoolMaxSize and ConnectionMaxWaitMilliseconds typically.
>
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> <http://rmannibucau.wordpress.com> | Github <
> https://github.com/rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> <http://www.tomitribe.com>
>
> 2015-08-10 2:57 GMT-07:00 seba.wagner@gmail.com <se...@gmail.com>:
>
> > Hi all,
> >
> > I just started to use Tomee and I really like the simplicity that it
> brings
> > to my app.
> >
> > But I have an issue with ActiveMQ
> >
> > I have set up the queue according to the docs at here:
> > http://activemq.apache.org/tomee.html
> >
> > <tomee>
> >     <Resource id="MyJmsResourceAdapter" type="ActiveMQResourceAdapter">
> >         BrokerXmlConfig =  broker:(tcp://someHostName:61616)
> >         ServerUrl       =  vm://localhost
> >     </Resource>
> >
> >     <Resource id="MyJmsConnectionFactory"
> > type="javax.jms.ConnectionFactory"
> > >
> >         ResourceAdapter = MyJmsResourceAdapter
> >     </Resource>
> > </tomee>
> >
> > I can successfully send message to the queue and check with JConsole the
> > queue length.
> > But after sending a couple of messages the I receive an exception like
> > this:
> > javax.jms.JMSException: No ManagedConnections available within configured
> > blocking timeout ( 5000 [ms] ) for pool
> >
> >
> org.apache.geronimo.connector.outbound.SinglePoolConnectionInterceptor@6581542c
> > at
> >
> >
> org.apache.activemq.ra.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:101)
> > at
> >
> >
> org.apache.activemq.ra.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:67)
> >
> > I first thought it might be an issue with JConsole blocking the queue or
> > something. But it also happen when there is no JConsole and I restart all
> > services from scratch.
> >
> > There must be some connection pool config et cetera?
> >
> > Where can I modify the Number of Connections that are pooled and handle
> > this more gracefully in Tomee?
> >
> > Thanks for your help,
> >
> > Sebastian
> >
> > --
> > Sebastian Wagner
> > https://twitter.com/#!/dead_lock
> > seba.wagner@gmail.com
> >
> >
> >
> > --
> > Sebastian Wagner
> > https://twitter.com/#!/dead_lock
> > seba.wagner@gmail.com
> >
>



-- 
Sebastian Wagner
https://twitter.com/#!/dead_lock
seba.wagner@gmail.com

Re: Configuring number of connections/pool for ActiveMQ

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

you can configure the PoolingSupport in the connection  factory to setting
PoolMaxSize and ConnectionMaxWaitMilliseconds typically.


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

2015-08-10 2:57 GMT-07:00 seba.wagner@gmail.com <se...@gmail.com>:

> Hi all,
>
> I just started to use Tomee and I really like the simplicity that it brings
> to my app.
>
> But I have an issue with ActiveMQ
>
> I have set up the queue according to the docs at here:
> http://activemq.apache.org/tomee.html
>
> <tomee>
>     <Resource id="MyJmsResourceAdapter" type="ActiveMQResourceAdapter">
>         BrokerXmlConfig =  broker:(tcp://someHostName:61616)
>         ServerUrl       =  vm://localhost
>     </Resource>
>
>     <Resource id="MyJmsConnectionFactory"
> type="javax.jms.ConnectionFactory"
> >
>         ResourceAdapter = MyJmsResourceAdapter
>     </Resource>
> </tomee>
>
> I can successfully send message to the queue and check with JConsole the
> queue length.
> But after sending a couple of messages the I receive an exception like
> this:
> javax.jms.JMSException: No ManagedConnections available within configured
> blocking timeout ( 5000 [ms] ) for pool
>
> org.apache.geronimo.connector.outbound.SinglePoolConnectionInterceptor@6581542c
> at
>
> org.apache.activemq.ra.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:101)
> at
>
> org.apache.activemq.ra.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:67)
>
> I first thought it might be an issue with JConsole blocking the queue or
> something. But it also happen when there is no JConsole and I restart all
> services from scratch.
>
> There must be some connection pool config et cetera?
>
> Where can I modify the Number of Connections that are pooled and handle
> this more gracefully in Tomee?
>
> Thanks for your help,
>
> Sebastian
>
> --
> Sebastian Wagner
> https://twitter.com/#!/dead_lock
> seba.wagner@gmail.com
>
>
>
> --
> Sebastian Wagner
> https://twitter.com/#!/dead_lock
> seba.wagner@gmail.com
>