We start with a class that simply creates a server and a client. The server class is configured to accept a connection and then exit, forcing of course, all connections to terminate. The client class connects, then sleeps two seconds…
Is a JMS MessageConsumer truly asynchronous/non-blocking?
Yes. The code tree is as follows: Receive call on the ActiveMQMessageConsumer class, which implements the javax.jms.MessageConsumer interface… public javax.jms.Message receive() throws JMSException { checkClosed(); checkMessageListener(); sendPullCommand(0L); MessageDispatch md = dequeue(-1L); if (md == null) { return null; } beforeMessageIsConsumed(md);…
Testing ActiveMQ with JMeter
Create a normal JMeter test with a ThreadGroup. Add a JMS Point to Point component, as shown below… Add the following configurations, which I couldn’t show in a single window (not enough space). In Apache 2.11, ActiveMQ libraries must already…
Using Spring AMQP to post messages to RabbitMQ
The ActiveMQ jar’s come with the AMQP 1.0 protocol, which doesn’t work against a RabbitMQ AMQP version 0.9.1 broker. As such, we use a spring jar to get this to work, thanks to this link. Very simple example of this.…
Camel route to consume external web service
I thought this was pretty difficult to find a very simple working example. The following works as an example of a polling consumer integration pattern… This will do a GET of the URL listed every 30 seconds, and write the…
Simple awk script to print blocked threads
Yet another variation on this theme. This is good because it will allow you to quickly go to the problem thread. #!/bin/awk -f { if ($0 ~ “- locked” || $0 ~ “- waiting to lock”) { s[i++]=$0 } }…