Author: Steve

Broken out into two routes…   Consume web service and enqueuer in ActiveMQ Dequeue from ActiveMQ and persist in PO object in Oracle database     <route id=”get-po”> <from uri=”timer://simpleTimer?period=30s”/> <to uri=”http://cmhlcarchapp01:8080/tradestone/send_po.jsp“/> <to uri=”jms:queue:testMQ” /> </route>   <route id=”insert-db”> <from…

Query SQL Server XML column for value

Just an example of how to pull this type of value from an embedded XML document in a SQL Server database table column… select top 100 * from Transactions with (nolock) where trn_xml.value(‘(/Transaction/RetailStoreId)[1]’, ‘int’) = 2401

Listing queues and topics in ActiveMQ

This will provide the list of queues and topics managed by an ActiveMQ broker… import javax.jms.*; import java.io.*; import java.util.*; import org.apache.activemq.*; import org.apache.activemq.command.*; import org.apache.activemq.advisory.*; public class GetDestinations { private static String url = ActiveMQConnection.DEFAULT_BROKER_URL; public static void main(String[]…

Where is my bundle in Karaf?

You can find the bundle by: * performing an osgi:list in the karaf shell * Take the bundle ID * navigate to the FUSE_BASE_DIR/data/cache/bundle${ID_ABOVE}/version* * jar -tvf bundle.jar This will show you the contents of the bundle, with which you…

Unexpected end of file from server

The “java.net.SocketException: Unexpected end of file from server” exception is thrown in the HTTPClient class, as well as others. This article simply provides an example of how to generate it for testing purposes. We start with a client class that…

Simulating a connection reset in java

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);…