STOMP support

With a customer we are looking how to connect Prolog to RabbitMQ for relatively low-traffic communication. We stumbled on STOMPL by @honnix. That didn’t really work anymore. I forked it and did some serious rewrites to simplify the STOMP frame (de)serialization, simplify the API and work towards lazy connection establishment (done) and automatic reconnect (not yet done). The new code is at GitHub - JanWielemaker/stompl: Prolog STOMP client

I think there are several more things that can be improved. Notably for ACK and NACK messages we can probably just pass the original message header? Eventually I plan to add this to the standard SWI-Prolog distribution as it is both pretty useful and small. Together with the Redis and ROS interfaces we build proof that Prolog can integrate into modern micro services architectures.

Is there anyone with concrete experience using STOMP who is willing to have a look at the current state and see what is missing, can be simplified/improved, etc.? Also, what is needed to deal with version 1.2 of the STOMP protocol?


I have been recently using websockets to connect Prolog and other clients.

I am curious – why stomp vs. WebSockets – which is already supported …

@jan Thanks for the fork and improvement. I have completely lost my memory how this works unfortunately, so I can’t help much.

@grossdan Yeah if websocket is now the better way connecting to RabbitMQ, maybe we should use that instead. I might be wrong (too many years), but when this was written there wasn’t good support of websockets, and stomp was a good option.

@honnix Thanks for the code. I reimplemented a lot, but given your starting point that was a lot less work than figuring out the STOMP protocol and implement from scratch.

P.s. If it moves into the standard distribution I would prefer to relicense under BSD-2 to keep the license as simple as possible. Would you agree with changing the license?

Websockets are a more low level protocol. They merely provided message delimiting and very limited meta-data on top of a stream. A STOMP frame consists of a command, arbitrary set of name/value pairs and an arbitrary body. On top of that, STOMP specifies how to subscribe to topics, how to combine multiple messages in a single transaction and a few more of these.

1 Like

@jan Yes, absolutely OK, BSD-2 sounds good to me. I’m super excited to see this code could serve something much useful than my prototype project years back. :slight_smile: I will go ahead archive my repo because it is not working anyway, and refer to your fork.

Thanks for explaining what websockets offer.