JMS Simulation does not shutdown after successful run

Hi,

we have a simulation that does jms reqreply against Oracle AQ. The simulation runs just fine, but at the end it does not terminate properly and keeps hanging during shutdown (every time we run the simulation).

What is a correct way of forcing the simulation to terminate after is has succeeded?

Regards, Stephan

I have figured out why it is not shutting down. We use Oracle AQ. The simulation terminates but for some reason the ConnectionFactory is not closed and there are session to the database still open.

Now I have to figure out how to fix it.

Mmmm, except if it’s something specific to Oracle AQ, you don’t close a ConnectionFactory, it’s just a factory.

We automatically close the producer, the session and the connection + the listener threads.
https://github.com/gatling/gatling/blob/master/gatling-jms/src/main/scala/io/gatling/jms/client/SimpleJmsClient.scala#L156-L158

https://github.com/gatling/gatling/blob/master/gatling-jms/src/main/scala/io/gatling/jms/action/JmsReqReplyAction.scala#L92

You should monitor and check which threads are still alive exactly.

After digging a bit deeper into the JmsReqReplyAction it looks like the postStop() hangs on closing the listenerThreads.

override def postStop(): Unit = {
  listenerThreads.foreach(_.close())
  client.close()
}

At https://github.com/gatling/gatling/blob/master/gatling-jms/src/main/scala/io/gatling/jms/action/JmsReqReplyAction.scala#L83 the join() never returns for some reason.

I am a bit puzzled.

I introduced a timeout on the join, but no idea what the root cause might be.
https://github.com/gatling/gatling/issues/2745

It looks like it is still in the waiting loop for

val m = replyConsumer.receive(receiveTimeout)

when I define the receiveTimeout on the jmsConfig it actually stop with the message

16:14:45.308 [ERROR] i.g.j.JmsReqReplyAction - Blocking receive returned null. Possibly the consumer was closed.

I will give it a try! Thanks!

Hi Stephen,

Did you get this working?

I see exactly same error, but not sure how to get this working.

“[ERROR] i.g.j.a.JmsReqReplyActor - Blocking receive returned null. Possibly the consumer was closed.”

Please can you advise

Thanks