wso2 / product-ei

An open source, a high-performance hybrid integration platform that allows developers quick integration with any application, data, or system.
https://wso2.com/integration/
Apache License 2.0
374 stars 281 forks source link

[EI61][JMS] Intermittent Issue - JMS session closed after broken jms connection #358

Closed Dilshani closed 1 month ago

Dilshani commented 7 years ago

Environment Operating Systems : Redhat and Debian Java Version : JDK1.8 Packs : EI610 PreAlpha Pack ESB Setup: Cluster DB - Oracle 12c Broker - ActiveMQ

Preconditions JMS broker should be configured with EI

Steps to reproduce Break the connection of JMS broker for a long time (Ex: few hours) Restart JMS broker Integration server create connection. Created an API which will store messages in JMS message store (Existing message store) Invoke API

Expected Result Message should store in JMS message store successfully

Actual Result Getting an error as follows:

TID: [-1234] [] [2017-03-24 12:36:14,593] ERROR {org.apache.synapse.message.store.impl.jms.JmsProducer} -  [MS2-P-1]. Ignored MessageID : urn:uuid:e9f6c2da-61d6-4231-98cd-75cadbb27097. Could not store message to store [MS2]. Error:The Session is closed {org.apache.synapse.message.store.impl.jms.JmsProducer}
javax.jms.IllegalStateException: The Session is closed
    at org.apache.activemq.ActiveMQSession.checkClosed(ActiveMQSession.java:731)
    at org.apache.activemq.ActiveMQSession.configureMessage(ActiveMQSession.java:719)
    at org.apache.activemq.ActiveMQSession.createObjectMessage(ActiveMQSession.java:380)
    at org.apache.synapse.message.store.impl.jms.JmsProducer.storeMessage(JmsProducer.java:82)
    at org.apache.synapse.mediators.store.MessageStoreMediator.mediate(MessageStoreMediator.java:133)
    at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:89)
    at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:59)
    at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
    at org.apache.synapse.rest.Resource.process(Resource.java:343)
    at org.apache.synapse.rest.API.process(API.java:399)
    at org.apache.synapse.rest.RESTRequestHandler.apiProcess(RESTRequestHandler.java:120)
    at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:101)
    at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:69)
    at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:304)
    at org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:78)
    at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
    at org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:325)
    at org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:371)
    at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:151)
    at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
TID: [-1234] [] [2017-03-24 12:36:14,594] ERROR {org.apache.synapse.mediators.store.MessageStoreMediator} -  Failed to store message [urn:uuid:06b0e891-911c-413a-9c65-0b3c7b7e342d] in store [MS2]. {org.apache.synapse.mediators.store.MessageStoreMediator}
TID: [-1234] [] [2017-03-24 12:36:14,594] ERROR {API_LOGGER.JMSAPI} -  Failed to store message [urn:uuid:06b0e891-911c-413a-9c65-0b3c7b7e342d] in store [MS2]. {API_LOGGER.JMSAPI}
TID: [-1234] [] [2017-03-24 12:36:14,597]  INFO {org.apache.synapse.mediators.builtin.LogMediator} -  To: /jmsapi, MessageID: urn:uuid:06b0e891-911c-413a-9c65-0b3c7b7e342d, Direction: request, MESSAGE = Executing default 'fault' sequence, ERROR_CODE = 0, ERROR_MESSAGE = Failed to store message [urn:uuid:06b0e891-911c-413a-9c65-0b3c7b7e342d] in store [MS2]., Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body/></soapenv:Envelope> {org.apache.synapse.mediators.builtin.LogMediator}

Note : This issue can be see even through proxies and other services. It take several minutes (depend on the situation) to recover the session and work as expected.

erandacr commented 7 years ago

Did u enable caching for the jms store?

store.jms.cache.connection

Dilshani commented 7 years ago

Nope, Didn't enable caching.

erandacr commented 7 years ago

After disconnection (reconnection) from the broker, this error should come atleast once. But after that if the broker is running, next message should go through to the broker without any issue.