You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by PETRULIS Domas <Do...@3ds.com.INVALID> on 2023/02/28 09:43:03 UTC

Exception thrown in JmsTemplate.send session close

Hi,

Recently, we have updated artemis dependencies from 2.24.0 to latest 2.28.0 in our project. After the update we came upon a problem - we started noticing exceptions being printed out in logs after JmsTemplate message send.

Particular exception thrown:
[main] DEBUG org.apache.activemq.artemis.core.client.impl.ClientSessionImpl  - Calling close on session ClientSessionImpl [name=a3a3ffc2-b73f-11ed-af77-e86a64f1df39, username=artemis, closed=false, factory = org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl@13b3d178, metaData=(jms-session=,)]@2fc0cc3
[main] DEBUG org.apache.activemq.artemis.core.client.impl.ClientSessionImpl  - calling cleanup on ClientSessionImpl [name=a3a3ffc2-b73f-11ed-af77-e86a64f1df39, username=artemis, closed=false, factory = org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl@13b3d178, metaData=(jms-session=,)]@2fc0cc3
                at org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl.connectionDestroyed(ClientSessionFactoryImpl.java:383)
                at org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnector$Listener$1.run(NettyConnector.java:1214)
                at org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:58)
                at org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:33)
                at org.apache.activemq.artemis.utils.actors.ProcessorBase.executePendingTasks(ProcessorBase.java:69)
                at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
                at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[main] DEBUG org.apache.activemq.artemis.core.client.impl.ClientSessionImpl  - Session was already closed, giving up now, this=ClientSessionImpl [name=a3a3ffc2-b73f-11ed-af77-e86a64f1df39, username=artemis, closed=true, factory = org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl@13b3d178, metaData=(jms-session=,)]@2fc0cc3

Started to investigate the root cause of the problem.

We thought it was something to do with our configuration, however after creating a new demo project with default settings and starting a freshly insalled artemis broker it still seems to printout the exception after message send.
<bean id="connectionFactory" class="org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory">
                <property name="user" value="artemis"/>
                <property name="password" value="artemis"/>
                <property name="brokerURL" value="tcp://localhost:61616" />
</bean>
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
                <property name="connectionFactory" ref="connectionFactory" />
</bean>

After checking why the exception was not thrown in 2.24.0 compared to 2.28.0, it seems that the exception is actually thrown in the background, just not printed out for DEBUG as in 2.28.0.
As of https://github.com/apache/activemq-artemis/commit/9873fccf744c0cb0a25dd905fab67ea52ef7aa7d commit it changes the logging from TRACE to DEBUG in org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl#failoverOrReconnect which I assume logs it.

Message is sent and received correctly, it seems nothing breaks in the end, just that the exception is thrown after cleaning up the session.

Questions would be:
Is the exception thrown just used for logging and should we just skip it?
Is there some other problem we are facing which needs to be fixed so that the exception is not thrown after session close?

Thanks in advance!

This email and any attachments are intended solely for the use of the individual or entity to whom it is addressed and may be confidential and/or privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data privacy policy as described on our website. Should you have any questions related to personal data protection, please contact 3DS Data Protection Officer https://www.3ds.com/privacy-policy/contact/


Re: Exception thrown in JmsTemplate.send session close

Posted by Robbie Gemmell <ro...@gmail.com>.
This is a debug level log including a stack trace for reference. Its
not an exception being thrown to an application, or even logged at
error or warning level to indicate an issue to/with the applicaton. It
doesnt seem to be for indicating a problem at all and so seems fine
not to be concerned about. As you say, it seems it was also doing it
before, just at a different level.

Whatever logging implementation you are using in your application now
is handling the SLF4J loggers (which 2.27.0 changed to using, versus
its use of JBoss Logging before that) and is also configured to output
debug messages for the artemis loggers. Its not immediately clear
whether the latter is something you are doing deliberately or not,
it's often a little unusual? If you weren't similarly including a
necessary logging dep to handle the JBoss Logging loggers and
configuring it to output debug for the artemis loggers previously when
using 2.24.0, I expect you wouldnt have really seen any client logging
in comparison. I guess your not mentioning such a significant
difference would suggest that you were doing that before though.

On Tue, 28 Feb 2023 at 09:43, PETRULIS Domas
<Do...@3ds.com.invalid> wrote:
>
> Hi,
>
> Recently, we have updated artemis dependencies from 2.24.0 to latest 2.28.0 in our project. After the update we came upon a problem - we started noticing exceptions being printed out in logs after JmsTemplate message send.
>
> Particular exception thrown:
> [main] DEBUG org.apache.activemq.artemis.core.client.impl.ClientSessionImpl  - Calling close on session ClientSessionImpl [name=a3a3ffc2-b73f-11ed-af77-e86a64f1df39, username=artemis, closed=false, factory = org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl@13b3d178, metaData=(jms-session=,)]@2fc0cc3
> [main] DEBUG org.apache.activemq.artemis.core.client.impl.ClientSessionImpl  - calling cleanup on ClientSessionImpl [name=a3a3ffc2-b73f-11ed-af77-e86a64f1df39, username=artemis, closed=false, factory = org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl@13b3d178, metaData=(jms-session=,)]@2fc0cc3
>                 at org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl.connectionDestroyed(ClientSessionFactoryImpl.java:383)
>                 at org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnector$Listener$1.run(NettyConnector.java:1214)
>                 at org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:58)
>                 at org.apache.activemq.artemis.utils.actors.OrderedExecutor.doTask(OrderedExecutor.java:33)
>                 at org.apache.activemq.artemis.utils.actors.ProcessorBase.executePendingTasks(ProcessorBase.java:69)
>                 at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
>                 at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
> [main] DEBUG org.apache.activemq.artemis.core.client.impl.ClientSessionImpl  - Session was already closed, giving up now, this=ClientSessionImpl [name=a3a3ffc2-b73f-11ed-af77-e86a64f1df39, username=artemis, closed=true, factory = org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl@13b3d178, metaData=(jms-session=,)]@2fc0cc3
>
> Started to investigate the root cause of the problem.
>
> We thought it was something to do with our configuration, however after creating a new demo project with default settings and starting a freshly insalled artemis broker it still seems to printout the exception after message send.
> <bean id="connectionFactory" class="org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory">
>                 <property name="user" value="artemis"/>
>                 <property name="password" value="artemis"/>
>                 <property name="brokerURL" value="tcp://localhost:61616" />
> </bean>
> <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
>                 <property name="connectionFactory" ref="connectionFactory" />
> </bean>
>
> After checking why the exception was not thrown in 2.24.0 compared to 2.28.0, it seems that the exception is actually thrown in the background, just not printed out for DEBUG as in 2.28.0.
> As of https://github.com/apache/activemq-artemis/commit/9873fccf744c0cb0a25dd905fab67ea52ef7aa7d commit it changes the logging from TRACE to DEBUG in org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl#failoverOrReconnect which I assume logs it.
>
> Message is sent and received correctly, it seems nothing breaks in the end, just that the exception is thrown after cleaning up the session.
>
> Questions would be:
> Is the exception thrown just used for logging and should we just skip it?
> Is there some other problem we are facing which needs to be fixed so that the exception is not thrown after session close?
>
> Thanks in advance!
>
> This email and any attachments are intended solely for the use of the individual or entity to whom it is addressed and may be confidential and/or privileged.
>
> If you are not one of the named recipients or have received this email in error,
>
> (i) you should not read, disclose, or copy it,
>
> (ii) please notify sender of your receipt by reply email and delete this email and all attachments,
>
> (iii) Dassault Systèmes does not accept or assume any liability or responsibility for any use of or reliance on this email.
>
>
> Please be informed that your personal data are processed according to our data privacy policy as described on our website. Should you have any questions related to personal data protection, please contact 3DS Data Protection Officer https://www.3ds.com/privacy-policy/contact/
>