On Oct 5, 2006, at 6:40 AM, nbreau wrote:
I'm not sure if this issue is related.... my issue occurs randomly,
within
the first 50-100 messages that get sent, and it's only a single
producer
that hangs, but over time all my producer threads would become hung.
Is there some kind of timeout i can apply to a publish call ?
Unfortunately the useAsyncSend setting doesn't have the entire
semantic you might expect. At the lowest level it will still perform
synchronous network operations in the same thread as your publish.
This means that if there's a TCP backlog (because of a slow network,
down network, throttling broker, buggy broker, etc. etc.) then even
the async send can block.
One thing to check would be to connect to your broker with JMX and
look at the thread handling the hung connection and see if and where
it's blocked. If it's blocked on the UsageManager then you need to
either raise your UsageManager memory limit or turn on the new non-
blocking UsageManager flag.
If it's not blocked on the UsageManager then you're probably hitting
an unknown problem. If you could find the blockage and let us know
where it is that would rock (assuming it's not just a problem on your
network).
I've got a transport filter I've been meaning to submit that sits in
front of almost all other transport filters and provides true
asynchronous sending by adding a tiny client-side queue. This helps
avoid bugs in transport code, hitches in the network, and hitches in
the broker that could otherwise lead to publish blocking. I'll get
that dusted off and published. The downside to it is that it means
publishes are 100% unthrottled, which can easily lead to dropped
messages if you publish too fast (it throws and exception so you know
what's happening at least).
John