As far as the JBoss 7/EAP6 does not allow to reuse the MessageProducer across the different transactions for a transactional messaging sending (transactional session), we are obliged to follow the rule: if you would like to send the tx message, create the new producer within the transaction you would like to join.
The reason behind that is out of HornetQ scope, but I would like to understand the cost of HornetQ for the frequently created producers.
What I've got so far:
- create producer:
- acquire the lock for the managed connection - HornetQRASession
- send the blocking packet over channel - ClientSessionImpl
- synchronize on sendBlockingLock
- encode the packet
- acquire the channel lock
- instantiate the BindingsImpl and populate it with the all bindings for the address - SimpleAddressManager
- the latter confuses a bit, further only BindingQuery#isExists is being used!
- synchronize on the list of session's producers - ClientSessionImpl
- synchronize on the list of session's producers - HornetQRASession
- ....and few instantiations and filling of the arrays with the bindings names between the different layers.
- remove producer:
- return credits - ClientSessionImpl
- synchronize on the list of session's producers - HornetQRASession
Quite a lot. Under the high loading, occasionally we receive the "Timed out waiting for response when sending packet 49", i.e. for the "session binding query".
Thoughts?
Thanks,
Konstantin