[ 
https://issues.apache.org/jira/browse/ARTEMIS-2934?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17283397#comment-17283397
 ] 

Justin Bertram commented on ARTEMIS-2934:
-----------------------------------------

It would be possible to limit the SESSION_CREATED and SESSION_CLOSED 
notifications so that they're only sent for MQTT connections given that they 
were added specifically for an MQTT use-case. However, I see potential for 
these notifications to be used in the future for other more general kinds of 
cluster state use-cases so I'm hesitant to relegate them to MQTT only.

As you note, this issue is triggered by an anti-pattern in Spring. Spring's 
JMSTemplate suffers from this as well and has caused a lot of issues over the 
years. Spring is open-source just like ActiveMQ Artemis so I would assume this 
issue could be fixed there just as easily as here. I'm not trying to pass the 
buck, but at this point the problem appears to be rooted there.

It's certainly possible that these notifications could eventually be shown to 
cause problems in a normal use-case, but until we have clear evidence of that 
I'm not particularly motivated to change the code on behalf of Spring's 
antipattern.

> ARTEMIS-2226 causes excessive notificaions to be sent for Spring XA clients
> ---------------------------------------------------------------------------
>
>                 Key: ARTEMIS-2934
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2934
>             Project: ActiveMQ Artemis
>          Issue Type: New Feature
>            Reporter: Anton Roskvist
>            Priority: Minor
>
> Hi,
> The fix in https://issues.apache.org/jira/browse/ARTEMIS-2226 causes 
> excessive notifications to be sent for clients running XA transaction through 
> the Spring framework.
> The notifications sent are SESSION_CREATED and SESSION_CLOSED.
> I strongly suspect this is because Spring DMLC cannot cache consumers 
> properly when running XA, causing it to create and remove a new session for 
> each message processed.
> Now I am not arguing that is not bad practice, because it is, but lots of 
> applications run on top of this logic. I also suspect this might affect more 
> but not be as pronounced.
>  
> I have been able to prove the aforementioned patch is what causes the issue 
> by removing:
> sendSessionNotification(CoreNotificationType.SESSION_CREATED);
> and
> sendSessionNotification(CoreNotificationType.SESSION_CLOSED);
> from ServerSessionImpl.java (they where added in the patch)
> Now I do not fully understand the intent of the original patch but I think it 
> should be made conditional, that is, send those notifications only for MQTT 
> session or something similar.
>  
> In the environment I am testing this on the difference is huge as I have a 
> lot of independent applications all running Spring+XA. About 40% of all 
> messages getting sent and received are notifications.
>  
> Br,
> Anton



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to