kookster / activemessaging Goto Github PK
View Code? Open in Web Editor NEWActiveMessaging moved from google code - this will be the latest and greatest
ActiveMessaging moved from google code - this will be the latest and greatest
Hi,
Whenever I restart my AMQ server, I loose the connection between it and AM. The Number of Consumers keeps on 0. Doesn't AM should reconnect to AMQ on this cases?
TIA,
Sandro
Add admin topic and statistics support for activemq and other brokers that support such a thing
http://www.pubbs.net/activemq/200912/52702/
Add default filters that can be used to do admin reporting and progress reporting for messages and tasks
I installed activemessaging
and I'm trying to make it work with AmazonMQ right now, when I set it up it does not seem to subscribe at all to my topic
.
Is this gem still working and maintained, or not at all?
# processor
class UpdateFrontendManifestProcessor < ApplicationProcessor
subscribes_to :update_frontend_manifest
def on_message(message)
logger.debug "UpdateFrontendManifestTopicProcessor received: " + message
end
end
# broker.yml
development:
adapter: stomp
login: "test"
passcode: "my-pass"
host: "address.amazonaws.com"
port: 61614
reliable: true
# messaging.rb
ActiveMessaging::Gateway.define do |s|
s.destination :update_frontend_manifest, '/topic/update_frontend_manifest'
end
We are using activemessaging gem version 0.9.0. We use poller to start and stop the subscriber. We have durable subscriber and when we stop the poller, gem sends UNSUBSCRIBE command to activemq in addition to DISCONNECT command.
We do not want to unsubscribe as subscriber is durable and if it is no longer subscribed, it will loose any message which came on the topic while it was offline.
Do you think this feature is reasonable and, if yes, we could work to provide a patch to add an option to avoid unsubscribing.
the google discussion group isn't very active, but many months ago a guy named sylvain said he had created a mock adapter
there doesn't appear to be one in github and i get the idea there is also an SVN repo somewhere
my question is kind of vague, but i'm wondering if this git repo is the "official" repo for activemessaging for rails and/or if there is useful stuff like a mock adapter -- and more? -- somewhere else?
cheers!
When I add this gem to my Gemfile, run bundle update, then run rails console I get the following error
Mio:~/source/pictur:$ rails console
DEPRECATION WARNING: RAILS_DEFAULT_LOGGER is deprecated. Please use ::Rails.logger. (called from /Users/scott/source/pictur/config/application.rb:7)
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/deprecation.rb:33:in method_missing': undefined method
debug' for nil:Rails::DeprecatedConstant (NoMethodError)
from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/activemessaging-0.7.1/lib/activemessaging/support.rb:2
from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/activemessaging-0.7.1/lib/activemessaging.rb:31:in require' from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/activemessaging-0.7.1/lib/activemessaging.rb:31:in
load_extensions'
from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/activemessaging-0.7.1/lib/activemessaging.rb:88:in load_activemessaging' from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/activemessaging-0.7.1/lib/activemessaging.rb:117 from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:64:in
require'
from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:64:in require' from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:62:in
each'
from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:62:in require' from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:51:in
each'
from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:51:in require' from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler.rb:112:in
require'
from /Users/scott/source/pictur/config/application.rb:7
from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/commands.rb:21:in require' from /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/commands.rb:21 from script/rails:6:in
require'
from script/rails:6
My gem file is like:
gem 'celluloid'
gem 'activemessaging', :git => 'https://github.com/kookster/activemessaging.git'
gem "daemons"
gem 'amqp'
When I run script/poller run I get the following exception:
=> Subscribing to /queue/HelloWorldProcessor (processed by HelloWorldProcessorProcessor)
RuntimeError: Unknown messaging adapter :amqp!
/Users/noelrocha/.rvm/gems/ruby-1.9.3-p125/bundler/gems/activemessaging-434f6d901959/lib/activemessaging/gateway.rb:126:in `connection'
/Users/noelrocha/.rvm/gems/ruby-1.9.3-p125/bundler/gems/activemessaging-434f6d901959/lib/activemessaging/gateway.rb:392:in `subscribe'
/Users/noelrocha/.rvm/gems/ruby-1.9.3-p125/bundler/gems/activemessaging-434f6d901959/lib/activemessaging/gateway.rb:140:in `block in subscribe'
/Users/noelrocha/.rvm/gems/ruby-1.9.3-p125/bundler/gems/activemessaging-434f6d901959/lib/activemessaging/gateway.rb:140:in `each'
/Users/noelrocha/.rvm/gems/ruby-1.9.3-p125/bundler/gems/activemessaging-434f6d901959/lib/activemessaging/gateway.rb:140:in `subscribe'
/Users/noelrocha/.rvm/gems/ruby-1.9.3-p125/bundler/gems/activemessaging-434f6d901959/lib/activemessaging/gateway.rb:31:in `start'
/Users/noelrocha/.rvm/gems/ruby-1.9.3-p125/bundler/gems/activemessaging-434f6d901959/lib/activemessaging.rb:130:in `start'
/Users/noelrocha/tmp/test_messagequeue/lib/poller.rb:22:in `<top (required)>'
/Users/noelrocha/.rvm/gems/ruby-1.9.3-p125/gems/daemons-1.1.9/lib/daemons/application.rb:203:in `load'
/Users/noelrocha/.rvm/gems/ruby-1.9.3-p125/gems/daemons-1.1.9/lib/daemons/application.rb:203:in `start_load'
/Users/noelrocha/.rvm/gems/ruby-1.9.3-p125/gems/daemons-1.1.9/lib/daemons/application.rb:294:in `start'
/Users/noelrocha/.rvm/gems/ruby-1.9.3-p125/gems/daemons-1.1.9/lib/daemons/controller.rb:73:in `run'
/Users/noelrocha/.rvm/gems/ruby-1.9.3-p125/gems/daemons-1.1.9/lib/daemons.rb:147:in `block in run'
/Users/noelrocha/.rvm/gems/ruby-1.9.3-p125/gems/daemons-1.1.9/lib/daemons/cmdline.rb:109:in `call'
/Users/noelrocha/.rvm/gems/ruby-1.9.3-p125/gems/daemons-1.1.9/lib/daemons/cmdline.rb:109:in `catch_exceptions'
/Users/noelrocha/.rvm/gems/ruby-1.9.3-p125/gems/daemons-1.1.9/lib/daemons.rb:146:in `run'
script/poller:24:in `<main>'
Cleaning up...
I added 'activemessaging' to my Gemfile, but "rails g active_messaging:install" failed, looking 'celluloid'.
Can you change the poller template so that it requires 'active_support' rather than 'activesupport' - stop the deprecation message.
Okay, so something weird is going on here. Your .gemspec has lots of commented out #s.add_runtime_dependency(%q<activemessaging>, [">= 0"])
lines and a comment I don't quite understand about blocking the gem from installing.
Are you attempting to prevent this gem from being installed?
If so, why? If not, how can I fix it so I can install the gem?
$ gem install activemessaging
ERROR: Error installing activemessaging:
activemessaging requires activemessaging (>= 0)
Thanks
Am I reading this chunk of _dispatch in gateway.rb correctly?
execute_filter_chain(:incoming, message, routing) do |m|
result = subscription.processor_class.new.process!(m)
end
A new processor object is created for each message? Would it not be better cache the processor object in subscribe_to?
From what I can tell there's no support for ssl over stomp protocol (commonly called "stomp+ssl"). If I'm sending login credentials over the wire I want to make sure it's not in the clear even with proper firewalling.
The load_extensions method from ActiveMessaging is referencing a file (activemessaging/support.rb) which no longer exists.
I'm getting the error
NameError: cannot load Java class javax.jms.MessageListener
when I try to run a Rails app using Activemessaging (gem version 0.7.1), it seems a required jar file is missing. Any ideas on the best way to deal with this?
Cheers,
When I try to run 'rails g active_messaging:install' (this is after adding 'celluloid' to my Gemfile), it fails, looking for /config/messaging.rb. Which I don't have. Do I need one? Might not the generator generate that?
=> Unsubscribing from /queue/Test (processed by TestProcessor)
/Users/hanqing/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/psych.rb:203:in parse': (<unknown>): did not find expected key while parsing a block mapping at line 11 column 5 (Psych::SyntaxError) from /Users/hanqing/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/psych.rb:203:in
parse_stream'
from /Users/hanqing/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/psych.rb:151:in parse' from /Users/hanqing/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/psych.rb:127:in
load'
from /Users/hanqing/.rvm/gems/ruby-1.9.3-p448@huntor_pscrm/bundler/gems/activemessaging-35baeebb23a7/lib/activemessaging/gateway.rb:369:in load_connection_configuration' from /Users/hanqing/.rvm/gems/ruby-1.9.3-p448@huntor_pscrm/bundler/gems/activemessaging-35baeebb23a7/lib/activemessaging/gateway.rb:124:in
connection'
from /Users/hanqing/.rvm/gems/ruby-1.9.3-p448@huntor_pscrm/bundler/gems/activemessaging-35baeebb23a7/lib/activemessaging/gateway.rb:399:in unsubscribe' from /Users/hanqing/.rvm/gems/ruby-1.9.3-p448@huntor_pscrm/bundler/gems/activemessaging-35baeebb23a7/lib/activemessaging/gateway.rb:144:in
block in unsubscribe'
from /Users/hanqing/.rvm/gems/ruby-1.9.3-p448@huntor_pscrm/bundler/gems/activemessaging-35baeebb23a7/lib/activemessaging/gateway.rb:144:in each' from /Users/hanqing/.rvm/gems/ruby-1.9.3-p448@huntor_pscrm/bundler/gems/activemessaging-35baeebb23a7/lib/activemessaging/gateway.rb:144:in
unsubscribe'
from /Users/hanqing/.rvm/gems/ruby-1.9.3-p448@huntor_pscrm/bundler/gems/activemessaging-35baeebb23a7/lib/activemessaging/gateway.rb:118:in stop' from /Users/hanqing/.rvm/gems/ruby-1.9.3-p448@huntor_pscrm/bundler/gems/activemessaging-35baeebb23a7/lib/activemessaging/gateway.rb:80:in
ensure in start'
from /Users/hanqing/.rvm/gems/ruby-1.9.3-p448@huntor_pscrm/bundler/gems/activemessaging-35baeebb23a7/lib/activemessaging/gateway.rb:81:in start' from /Users/hanqing/.rvm/gems/ruby-1.9.3-p448@huntor_pscrm/bundler/gems/activemessaging-35baeebb23a7/lib/activemessaging.rb:130:in
start'
from /Users/hanqing/hanqing/workspace/pscrm/lib/poller.rb:22:in <top (required)>' from /Users/hanqing/.rvm/gems/ruby-1.9.3-p448@huntor_pscrm/gems/daemons-1.1.9/lib/daemons/application.rb:203:in
load'
from /Users/hanqing/.rvm/gems/ruby-1.9.3-p448@huntor_pscrm/gems/daemons-1.1.9/lib/daemons/application.rb:203:in start_load' from /Users/hanqing/.rvm/gems/ruby-1.9.3-p448@huntor_pscrm/gems/daemons-1.1.9/lib/daemons/application.rb:294:in
start'
from /Users/hanqing/.rvm/gems/ruby-1.9.3-p448@huntor_pscrm/gems/daemons-1.1.9/lib/daemons/controller.rb:73:in run' from /Users/hanqing/.rvm/gems/ruby-1.9.3-p448@huntor_pscrm/gems/daemons-1.1.9/lib/daemons.rb:147:in
block in run'
from /Users/hanqing/.rvm/gems/ruby-1.9.3-p448@huntor_pscrm/gems/daemons-1.1.9/lib/daemons/cmdline.rb:109:in call' from /Users/hanqing/.rvm/gems/ruby-1.9.3-p448@huntor_pscrm/gems/daemons-1.1.9/lib/daemons/cmdline.rb:109:in
catch_exceptions'
from /Users/hanqing/.rvm/gems/ruby-1.9.3-p448@huntor_pscrm/gems/daemons-1.1.9/lib/daemons.rb:146:in `run'
Hello!
I'm trying to install and launch ActiveMessaging, but with no luck.
Installation from gem doesn't work (see #27 and #41). Could you please publish new version.
Installation from git checkout also fails:
# Gemfile
gem 'activemessaging', github: 'kookster/activemessaging'
but after succesful bundle install
$ bundle
Fetching gem metadata from https://rubygems.org/............
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
...
Using activemessaging 0.13.0 from git://github.com/kookster/activemessaging.git (at master)
...
Bundle complete! 36 Gemfile dependencies, 91 gems now installed.
I'm always getting:
$ bundle exec rails server
Could not find activemessaging-0.13.0 in any of the sources
Run `bundle install` to install missing gems.
Don't ever know how to debug this. Ruby on Rails 4.2, Ruby 2.2.3.
Can you help?
I run the poller using RAILS_ENV=integration bundle exec script/poller run
. It processes messages correctly although I get relatively frequent "resetting connection" messages.
poller: process with pid 74811 started.
connection.receive returning EOF as nil - resetting connection.
connection.receive returning EOF as nil - resetting connection.
connection.receive returning EOF as nil - resetting connection.
connection.receive returning EOF as nil - resetting connection.
connection.receive returning EOF as nil - resetting connection.
connection.receive returning EOF as nil - resetting connection.
connection.receive returning EOF as nil - resetting connection.
connection.receive returning EOF as nil - resetting connection.
connection.receive returning EOF as nil - resetting connection.
I see CLOSE_WAIT connections piling up in "sudo lsof | grep 61613":
ruby 74811 user 15u IPv6 0xffffff80118a6d80 0t0 TCP localhost:50892->localhost:61613 (CLOSE_WAIT)
ruby 74811 user 16u IPv6 0xffffff80118a6600 0t0 TCP localhost:50865->localhost:61613 (CLOSE_WAIT)
ruby 74811 user 17u IPv6 0xffffff800ea70600 0t0 TCP localhost:50896->localhost:61613 (CLOSE_WAIT)
ruby 74811 user 18u IPv6 0xffffff80118a5340 0t0 TCP localhost:50906->localhost:61613 (CLOSE_WAIT)
ruby 74811 user 19u IPv6 0xffffff80118a5ac0 0t0 TCP localhost:50925->localhost:61613 (CLOSE_WAIT)
ruby 74811 user 20u IPv6 0xffffff80118a4f80 0t0 TCP localhost:50928->localhost:61613 (CLOSE_WAIT)
ruby 74811 user 21u IPv6 0xffffff80118a4bc0 0t0 TCP localhost:50954->localhost:61613 (CLOSE_WAIT)
ruby 74811 user 22u IPv6 0xffffff80118a5700 0t0 TCP localhost:50964->localhost:61613 (CLOSE_WAIT)
ruby 74811 user 23u IPv6 0xffffff80118a4800 0t0 TCP localhost:50974->localhost:61613 (CLOSE_WAIT)
ruby 74811 user 24u IPv6 0xffffff80118a4440 0t0 TCP localhost:50978->localhost:61613 (ESTABLISHED)
My HornetQ logs are filled up with the disconnects as well:
13:17:59,475 WARN [org.hornetq.core.server] HQ222067: Connection failure has been detected: HQ119014: Did not receive data from /0:0:0:0:0:0:0:1%0:50982. It is likely the client has exited or crashed without closing its connection, or the network between the server and client has failed. You also might have configured connection-ttl and client-failure-check-period incorrectly. Please check user manual for more information. The connection will now be closed. [code=CONNECTION_TIMEDOUT]
13:17:59,476 WARN [org.hornetq.core.server] HQ222061: Client connection failed, clearing up resources for session 98b76aff-a21b-11e2-8568-695c1cfc13ed
13:17:59,477 WARN [org.hornetq.core.server] HQ222107: Cleared up resources for session 98b76aff-a21b-11e2-8568-695c1cfc13ed
13:19:01,506 WARN [org.hornetq.core.server] HQ222067: Connection failure has been detected: HQ119014: Did not receive data from /0:0:0:0:0:0:0:1%0:50987. It is likely the client has exited or crashed without closing its connection, or the network between the server and client has failed. You also might have configured connection-ttl and client-failure-check-period incorrectly. Please check user manual for more information. The connection will now be closed. [code=CONNECTION_TIMEDOUT]
13:19:01,509 WARN [org.hornetq.core.server] HQ222061: Client connection failed, clearing up resources for session bdb071e0-a21b-11e2-8568-695c1cfc13ed
13:19:01,510 WARN [org.hornetq.core.server] HQ222107: Cleared up resources for session bdb071e0-a21b-11e2-8568-695c1cfc13ed
Is this expected behavior? Should I be doing something differently?
Support subscribe headers as defined by activemq impl:
http://activemq.apache.org/stomp.html
If the STOMP gem throws an exception for some reason during its normal operation the Stomp adapter doesn't deal with it appropriately.
The adapter attempts to reconnect immediately by issuing a CONNECT frame. ActiveMQ rejects this CONNECT request as it believes the client is still connected, which is indeed the case. Exceptions appear in the ActiveMQ logs that state that the client is already connected. As ActiveMQ doesn't honor the CONNECT request ActiveMessaging becomes confused and gets wedged into an endless loop of sending CONNECT requests.
What ActiveMessaging should do in response to an exception from the STOMP gem is to close the connection and create a new one. This would, at the very least, cause the underlying socket to be closed causing ActiveMQ to see that the client has gone.
After creating a new Stomp connection object ActiveMessaging can then go through its reconnect logic.
Including ActiveMessaging in a Rails application will trigger ActiveMessaging.load_activemessage which in turn requires activemessage/threaded_poller.
This means that every time the Rails environment is loaded, it loads celluloid, which prints this method every time the process exits:
Terminating 4 actors...
Shutdown completed cleanly
At best, this is an annoyance, at worst, it's spawning 4 useless threads every time the Rails environment is loaded.
Given that the class isn't used unless the application executing the threaded_poller script, it should not be required in that file.
Expect a pull request shortly. :)
Support stomp 1.1
I have a destination called email_users, but it seems like when I publish to that destination, it's mapping to the URI and then trying to load the URI as the destination
eg
s.destination :email_users, '/queue/EmailUsers'
publish :email_users, 'foo'
You have not yet defined a destination named /queue/EmailUsers. Destinations currently defined are [email_users]
the ActiveMessaging::load_processors method has a "first" parameter that suppresses logging of the loading of application processor files, but loads them anyway
i noticed this because i have a constant defined in my processor class that i'm warned is being redefined
the problem seems to occur because the Railtie implementation calls "reload_activemesaging" which, in turn, reloads the processors -- later in my poller, we even explicitly load the processors a 3rd time
perhaps this is being done to overcome some other problem, but it seems like a simple change might fix eliminate the multiple processor loading
thoughts?
cheers!
Any hints to getting script/poller to work with Rails 3? I have successfully set up activemessaging and I can get it to process messages if I start a console and run "ActiveMessaging::start" but it won't work from the included script.
I get errors indicating it cannot find my config/*.yml files after config/environment.rb tries to load the application so I'm assuming there are path issues.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.