kiril-me commented on issue #2902:
URL: https://github.com/apache/activemq/issues/2902#issuecomment-7189434274

   Thanks for the pointers. The core use case:
   
   We're a JMS client of a broker we don't operate. A third-party provider runs 
ActiveMQ Classic and exposes it to us only through the http:// connector. Our 
network only allows outbound HTTP(S) through a proxy, so tcp://, ssl://and 
plain stomp:// aren't options. We can't change the broker's connectors, only 
ask the provider to upgrade the version.
   
   We need full JMS behaviour. Consumers use transacted sessions, prefetch, 
redelivery with backoff, and dead-letter queues. As far as I can tell, this is 
the case the [HTTP transport 
docs](https://activemq.apache.org/components/classic/documentation/http-and-https-transports-reference)
 describe: a JMS client tunnelling through a firewall, with REST/Ajax suggested 
for non-JMS clients.
   
   On the alternatives:
   
   REST endpoint: no transacted consume or prefetch, and still one message per 
request, so the same round-trip limit applies.
   ws://: as far as I can see, it's broker-side only and speaks STOMP/MQTT 
(WSServlet). WSTransportFactory only binds, so there's no OpenWire client for 
it. Using it would mean dropping the JMS client entirely, and the provider 
would have to enable a new connector.
   stomp://: raw TCP, which our network doesn't allow.
   Where it hurts. Our round trip to the broker is hundreds of milliseconds. 
Each http:// connection receives one command per GET, so under a backlog 
delivery is capped at about one command per round trip per connection. That 
counts message dispatches and also the Responses to commits.
   
   The only lever today is more connections. Each HTTP connection runs its own 
GET loop, send-only ones included. We already hold about 50 concurrent long 
polls against the provider's broker, each tying up a broker Jetty thread for up 
to 30 s. Adding more pushes against a thread pool we don't control.
   
   The proposal (details in the issue):
   
   Opt-in: the client asks for up to N already-queued commands per GET via a 
request header. The broker caps N and returns the count in a response header.
   No new format: the body reuses the existing length-prefixed TextWireFormat 
framing, so it's k commands back to back.
   Compatible both ways: an old client against a new broker, or a new client 
against an old broker, behaves exactly as today.
   Ordering unchanged: one queue, one reader thread.
   It pays off mainly for consumers that acknowledge or commit in batches. In 
the benchmark in the issue, a transacted consumer committing every 50 messages 
ran about 14× faster, with 9 GETs instead of 205 for 200 messages. That's 
because acknowledging every message lets only one dispatch queue up at a time. 
I'd expect this to help anyone stuck with JMS over HTTP-only egress, which is 
common in enterprise networks.
   
   This is a small, low-risk improvement to a transport that's already 
supported. I'm happy to adjust option names, the server default or anything 
else, and I have a patch with unit and end-to-end tests ready to open as a PR.


-- 
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]
For further information, visit: https://activemq.apache.org/contact


Reply via email to