Hi all,
first of all thanks a lot to everybody involved for creating this
great framework!
The problem I have though is that neither sender nor receiver really
recover from connectivity errors. I have been googling and also
searching this forum but it seems I am the first one to have these
problems.
1. Receiver (running on FreeBSD 8.0)
After a few million messages being received via ActiveMQ, the receiver
loses the connection with this exception:
ActiveMessaging?: thread[default]: Exception from connection.receive:
Packet parsing timeout
/usr/local/lib/ruby/gems/1.8/gems/stomp-1.1.6/lib/stomp/connection.rb:
352:in `_receive'
/usr/local/lib/ruby/gems/1.8/gems/stomp-1.1.6/lib/stomp/
connection.rb:347:in `synchronize'
/usr/local/lib/ruby/gems/1.8/gems/stomp-1.1.6/lib/stomp/
connection.rb:347:in `_receive'
/usr/local/lib/ruby/gems/1.8/gems/stomp-1.1.6/lib/stomp/
connection.rb:325:in `old_receive'
/usr/local/lib/ruby/gems/1.8/gems/stomp-1.1.6/lib/stomp/
connection.rb:335:in `receive'
/usr/local/lib/ruby/gems/1.8/gems/activemessaging-0.7.1/lib/
activemessaging/adapters/stomp.rb:61:in `receive'
/usr/local/lib/ruby/gems/1.8/gems/activemessaging-0.7.1/lib/
activemessaging/gateway.rb:36:in `start'
/usr/local/lib/ruby/gems/1.8/gems/activemessaging-0.7.1/lib/
activemessaging/gateway.rb:32:in `start'
/usr/local/lib/ruby/gems/1.8/gems/activemessaging-0.7.1/lib/
activemessaging/gateway.rb:31:in `each'
/usr/local/lib/ruby/gems/1.8/gems/activemessaging-0.7.1/lib/
activemessaging/gateway.rb:31:in `start'
/usr/local/lib/ruby/gems/1.8/gems/activemessaging-0.7.1/lib/
activemessaging.rb:111:in `start'
/usr/home/hte/Oystercatcher/CoreEngine/lib/poller.rb:27
/usr/local/lib/ruby/gems/1.8/gems/daemons-1.1.0/lib/daemons/
application.rb:203:in `load'
/usr/local/lib/ruby/gems/1.8/gems/daemons-1.1.0/lib/daemons/
application.rb:203:in `start_load'
/usr/local/lib/ruby/gems/1.8/gems/daemons-1.1.0/lib/daemons/
application.rb:292:in `start'
/usr/local/lib/ruby/gems/1.8/gems/daemons-1.1.0/lib/daemons/
controller.rb:73:in `run'
/usr/local/lib/ruby/gems/1.8/gems/daemons-1.1.0/lib/daemons.rb:143
/usr/local/lib/ruby/gems/1.8/gems/daemons-1.1.0/lib/daemons/
cmdline.rb:112:in `call'
/usr/local/lib/ruby/gems/1.8/gems/daemons-1.1.0/lib/daemons/
cmdline.rb:112:in `catch_exceptions'
/usr/local/lib/ruby/gems/1.8/gems/daemons-1.1.0/lib/daemons.rb:
142:in `run'
script/poller:23
Having this in processors/application.rb ...
def on_error(err)
logger.error "ApplicationProcessor::on_error: #{err.class.name}
rescued:\n" + \
err.message + "\n" + \
"\t" + err.backtrace.join("\n\t")
raise ActiveMessaging::AbortMessageException.new, err.message
end
.... and broker.yml set to reliable ...
adapter: stomp
# properties below are all defaults for this adapter
login: ""
passcode: ""
host: 192.168.178.8
port: 61612
reliable: true
reconnectDelay: 5
... I would expect that a13g recovers from this error and reconnects/
retries, no?
Obviously this does not happen and message processing simply ceases.
2. Sender (WinXP in a VirtualBox)
When sending messages, VBox seems to have a problem regarding keeping
the TCP connection alive and at some point loses it. This surely is no
a13g problem, but again, I would expect a13g to recover from this
error and retry:
I send with ...
publish :queue, message, {}, 600
... and get an ECONNRESET exception from which a13g never recovers
(unfortunately I have no trace here at the moment but I can try to
reproduce if necessary) so I tried this workaround which seems to
improve the situation but I am not sure if this is the right was to do
it:
begin
client = ActiveMessaging::Gateway.connection
client.send queue, message, {}
rescue Exception
Rails.logger.error "Caught exception: #{$!}, retrying..."
retry
end
Does anybody have any idea what I am doing wrong here?
Thanks a lot!