agent and messaging
mazz Dec 9, 2014 1:30 PMJust a heads up on what's been done the past few days wrt rhq.next agent and messaging.
Heiko has been playing with the rhq.msg stuff - which includes a broker, Java client API, and a RA integration in JEE. As was suggested by Heiko and John Sanda, I recently incorporated ListenableFuture (guava API) to the client API so it uses that now. In addition, the msg broker can be installed as a Wildfly Extension (so you enable/disable/configure it via the normal standalone.xml or JBoss CLI mechanism). The messaging framework is all based on ActiveMQ so you can use their other client APIs for other language support.
More interestingly, this messaging framework has a REST frontend that I've enabled and shipped in the broker wildfly extension. When you install the broker extension, you can now send and receive messages via REST. This will help enable our "dumb feeds" (as well as anyone else that wants to use the REST API). I've successfully tested this REST interface using simply wget and curl - it works pretty nicely. Again, all based on ActiveMQ.
I also finished a skeleton agent that also runs as a WildFly extension. It includes the broker extension so we now have an agent that can send/receive messages over the bus (and as mentioned before, this even means something will be able to talk to the agent even with something like curl or wget).
Becaue we do not yet have a real name for the project, this stuff is spread out in different places. You can see the rhq-msg stuff at: https://github.com/rhq-project/rhq-msg and the agent is at: https://github.com/jmazzitelli/rhq-next-agent
If you want a quick test of the agent and the REST API, you can easily build and test via mvn and curl to send a test message. First, build the BOM (which is in yet another repo - rhq-project/rhq-next-bom · GitHub ), then build rhq-msg, then build rhq-next-agent, run the rhq-next-agent distribution, and test with curl and see the agent receive it. Here's how:
1. git clone git@github.com:rhq-project/rhq-next-bom.git
2. (cd rhq-next-bom; mvn clean install)
3. git clone git@github.com:rhq-project/rhq-msg.git
4. (cd rhq-msg; mvn clean install)
5. git clone git@github.com:jmazzitelli/rhq-next-agent.git
6. (cd rhq-next-agent; mvn -Pdev clean install)
7. ./rhq-next-agent/rhq-next-agent-distro/target/wildfly-8.2.0.Final/bin/standalone.sh
8. curl -d "body={message: helloworld}" http://localhost:8080/rest/message/ping?type=queue
At this point, in your console where you started the agent, you'll see the agent log a message saying it received your helloworld message:
13:25:03,476 INFO [org.rhq.next.agent.extension.AgentService] (ActiveMQ Session Task-2) mazztower --> helloworld
This just shows that you were able to send a message from your command line (curl) over the bus via REST to the agent. The "mazztower -->" is the agent name (which is nothing more than the node name of your Wildfly host container).
In the future, the idea is that we'll have plugins or "feeds" that can send and receive data to/from the agent where those plugins or feeds can be running either in the agent VM (perhaps as wildfly extensions) or outside the agent but talking to the agent over the bus (via either this REST API, the Java API, or other ApacheMQ client API, of which I know there is C and others).
Anyway, just wanted to post this to let people know what's going on in the spirit of full disclosure