Sure,
the feature looks like:
<feature name="gs-lisa-activemq" version="${project.version}"
description="Provide JMS connection factory and ActiveMqBroker">
<feature>jms</feature>
<feature version="[4,5)">spring</feature>
<feature version="${activemq.version}">activemq-broker-noweb</feature>
<feature version="${activemq.version}">activemq-client</feature>
<feature version="${ops4j.pax.jms.version}">pax-jms-pool-pooledjms</feature>
<feature version="${ops4j.pax.jms.version}">pax-jms-activemq</feature>
<feature version="${camel.version}">camel-jms</feature>
<config name="org.ops4j.connectionfactory-lisa-amq">
name = lisa-amq
osgi.jndi.service.name = jms/lisa-amq
password = ${activemq.jms.password}
connectionFactoryType = ConnectionFactory
type = activemq
url = ${activemq.url}
user = ${activemq.jms.user}
# hints for pax-jms-config to use selected
org.ops4j.pax.jms.service.PooledConnectionFactoryFactory
pool = pooledjms
xa = false
# pooled-jms specific configuration of
org.messaginghub.pooled.jms.JmsPoolConnectionFactory
pool.idleTimeout = 10
pool.maxConnections = 10
pool.blockIfSessionPoolIsFull = true
pax.jms.managed = true
</config>
</feature>
Thanks and regards
Joerg
-----Original Message-----
From: Jean-Baptiste Onofre <[email protected]>
Sent: Freitag, 2. Juli 2021 14:53
To: [email protected]
Subject: Re: Shutdown issue ActiveMq
It should be fine if your feature installed pax-jms config has prerequisite.
Can you share snippet of your feature referencing activemq-broker ?
Regards
JB
> Le 2 juil. 2021 à 14:21, Jörg Jansen <[email protected]> a
> écrit :
>
> It's installed as a prerequisite feature (which is referenced by my
> customized boot feature).
>
> Regards,
> Joerg
>
> -----Original Message-----
> From: Jean-Baptiste Onofre <[email protected]>
> Sent: Freitag, 2. Juli 2021 14:07
> To: [email protected]
> Subject: Re: Shutdown issue ActiveMq
>
> Ah the broker is installed as a feature in Karaf ? I thought your broker was
> outside of Karaf (standalone).
>
> Does activemq-broker feature installed as boot feature ? Or do you install
> after startup using feature:install ?
>
> Regards
> JB
>
>> Le 2 juil. 2021 à 11:14, Jörg Jansen <[email protected]> a
>> écrit :
>>
>> Hi JB,
>>
>> I'm using the AUTO ack, but switching to CLIENT doesn't make any difference.
>> How can I change the AMQ pool?
>> From my understanding it should be the preferred way to use pooledjms.
>>
>> This behavior sounds to me, that it may be be a ordering problem in my
>> assembly.
>> The broker should be shutdown after all cliens.
>>
>> Regards,
>> Joerg
>>
>> -----Original Message-----
>> From: Jean-Baptiste Onofre <[email protected]>
>> Sent: Freitag, 2. Juli 2021 09:52
>> To: user <[email protected]>
>> Subject: Re: Shutdown issue ActiveMq
>>
>> Hi,
>>
>> Did you try with another kind of pooler ? Like "native" ActiveMQ pool
>> instead of wrapped pooledjms ?
>>
>> What kind of ack do you use in your Camel route ? AUTO (default) or CLIENT ?
>>
>> Regards
>> JB
>>
>>> Le 2 juil. 2021 à 08:05, Jörg Jansen <[email protected]> a
>>> écrit :
>>>
>>> Hi everybody,
>>>
>>> I'm facing a problem with our JMS connection, when shutting down the karaf
>>> container.
>>> The JMS connectionFactory is provided/configured via ops4j-jms.
>>> When shutting down karaf, I receive the message: "Caught exception trying
>>> rollback() when putting session back into the pool, will invalidate.
>>> javax.jms.IllegalStateException: The Session is closed".
>>>
>>> Does anybody have an idea how to fix it?
>>> Seaching for a workaround brings up to set the idleTimeout to 0, but this
>>> has no effect.
>>>
>>> The currently used versions are:
>>> Karaf: 4.3.2
>>> ActiveMq: 5.16.0
>>> Camel: 3.7.4
>>>
>>> Any help would be really appreciated.
>>>
>>> Additional details are available below.
>>>
>>> Thanks in advance,
>>> Joerg
>>>
>>>
>>> ********************************************************************
>>> Stacktrace
>>> ********************************************************************
>>> 2021-07-02T07:46:30,260 | WARN | Camel (gs-os-connector) thread #22 -
>>> JmsConsumer[AMQ.GSLISA.OS.BUFFERED-SPX] | JmsPoolSession
>>> | 213 - org.messaginghub.pooled.jms - 1.2.1 | Caught exception trying
>>> rollback() when putting session back into the pool, will invalidate.
>>> javax.jms.IllegalStateException: The Session is closed
>>> javax.jms.IllegalStateException: The Session is closed
>>> at
>>> org.apache.activemq.ActiveMQSession.checkClosed(ActiveMQSession.java:772)
>>> ~[?:?]
>>> at
>>> org.apache.activemq.ActiveMQSession.rollback(ActiveMQSession.java:597)
>>> ~[?:?]
>>> at
>>> org.messaginghub.pooled.jms.JmsPoolSession.close(JmsPoolSession.java:112)
>>> [!/:?]
>>> at
>>> org.springframework.jms.support.JmsUtils.closeSession(JmsUtils.java:109)
>>> [!/:?]
>>> at
>>> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.clearResources(DefaultMessageListenerContainer.java:1289)
>>> [!/:?]
>>> at
>>> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1135)
>>> [!/:?]
>>> at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
>>> [?:?]
>>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>>> [?:?]
>>> at java.lang.Thread.run(Unknown Source) [?:?]
>>>
>>>
>>> ********************************************************************
>>> Feature config
>>> ********************************************************************
>>> <feature name="gs-lisa-activemq" version="${project.version}"
>>> description="Provide JMS connection factory and ActiveMqBroker" >
>>> <feature>jms</feature> <feature version="[4,5)">spring</feature>
>>> <feature
>>> version="${activemq.version}">activemq-broker-noweb</feature>
>>> <feature version="${activemq.version}">activemq-client</feature>
>>> <feature
>>> version="${ops4j.pax.jms.version}">pax-jms-pool-pooledjms</feature>
>>> <feature
>>> version="${ops4j.pax.jms.version}">pax-jms-activemq</feature>
>>> <feature version="${camel.version}">camel-jms</feature>
>>>
>>> <config name="org.ops4j.connectionfactory-lisa-amq">
>>> name = lisa-amq
>>> osgi.jndi.service.name = jms/lisa-amq password =
>>> ${activemq.jms.password} connectionFactoryType = ConnectionFactory
>>> type = activemq url = ${activemq.url} user = ${activemq.jms.user}
>>>
>>> # hints for pax-jms-config to use selected
>>> org.ops4j.pax.jms.service.PooledConnectionFactoryFactory
>>> pool = pooledjms
>>> xa = false
>>>
>>> # pooled-jms specific configuration of
>>> org.messaginghub.pooled.jms.JmsPoolConnectionFactory
>>> pool.idleTimeout = 10
>>> pool.maxConnections = 10
>>> pool.blockIfSessionPoolIsFull = true pax.jms.managed = true
>>> </config> </feature>
>>>
>>>
>>
>