[openamq-dev] WireAPI thread safety
Martin Lucina
mato at imatix.com
Tue Aug 14 15:05:38 CEST 2007
Nick,
ndl at ravenbrook.com said:
> Ouch. I'm more than somewhat concerned by this. The phrase "should
> work fine" doesn't fill me with confidence. Hmm, did I miss out on
> anything in the doc?
The documentation does not discuss thread safety issues in WireAPI.
This should be fixed. :-)
> The application I'm working on will need to be multi-threaded. Can you
> give me any indications as to what operations will not be thread-safe
> in this new release?
> [...]
> Do I understand correctly that with the new release this isn't necessary?
As Martin says, you can use WireAPI to create multiple connections from
a single process, and this will work fine as long as you only use each
connection from a single OS thread. In fact, you can try this with the
current release and it will work but the WireAPI will hang on shutdown
(amq_client_connection_destroy) due to a known issue which has been
fixed.
> I thought the idea was that you have few connections (because they're
> time-consuming to instantiate) and many sessions (because these are
> cheap).
This is the intent of both the AMQP protocol specification (sessions in
WireAPI map to channels on a connection in the protocol) and of the way
WireAPI is designed. However, we have not had a customer requirement
for actually implementing multiple channels, so you will not be able to
open more than one session per connection. (While this is possible in
the current release, it won't work correctly.)
Incidentally, this limitation (single channel) is AFAIK also present in
the other AMQP broker implementations.
Regards,
-mato
More information about the openamq-dev
mailing list