pjfanning opened a new pull request, #1815:
URL: https://github.com/apache/pekko-connectors/pull/1815

   JMS/JakartaMS JmsTxSourceStage — non-blocking acknowledgment
   
   Problem: Await.result(envelope.commitFuture, ackTimeout) inside onMessage 
blocks the JMS provider's delivery thread until the user acknowledges the 
message. This causes thread starvation under load.
   
   Solution: Replace blocking with deferred execution via a 
ConcurrentLinkedQueue:
   
   1. onMessage no longer blocks — it drains any pending commit/rollback 
actions from previous messages, pushes the new envelope to the stream, and 
registers a commitFuture.onComplete callback that enqueues the action
   2. Next onMessage call drains the queue first, executing pending actions on 
the provider's thread before processing the new message
   3. Uses ExecutionContext.parasitic for the callback (cheap, no extra thread 
pool)
   
   Files changed:
   - jms/.../impl/JmsTxSourceStage.scala
   - jakartams/.../impl/JmsTxSourceStage.scala
   
   Removed: Await, TimeoutException imports, timeout/rollback handling in 
onMessage
   Added: ConcurrentLinkedQueue, ExecutionContext.parasitic, 
drainPendingActions() method


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to