JMSTimestamp Example

In this post under JMS, I will explain about JMSTimestamp with an example Note: I will be using JMS 2.0 api for this and future examples. JMSTimestamp is a header field which is only set by JMS Provider and contains a long value in milliseconds that represents the time when the message was handed over…… Continue reading JMSTimestamp Example

Advertisements

JMSMessageID example

In this post under JMS, I will explain about JMSMessageID with an example JMSMessageID is a header field which is only set by JMS Provider and contains a string value that uniquely identifies a message. JMSMessageID is set by the provider when the JMSProducer calls the send method. Before calling the JMSProducer’s send method, the…… Continue reading JMSMessageID example

Excluding exceptions from skipping

In my previous posts under Spring Batch, I showed that when reading, processing or writing records in a batch, exceptions can be thrown, we can skip them and move on to next record. This is done with xml configuration as shown below 1 <batch:job id=”importEmployees”> 2 <batch:step id=”readWriteEmployees”> 3 <batch:tasklet> 4 <batch:chunk reader=”reader” writer=”writer” commit-interval=”50″…… Continue reading Excluding exceptions from skipping

Sending JMS messages in a Transaction

In this post under JMS, I will explain how to send JMS messages in a Transaction. If you are running your code in Java SE environment or Java EE application client side code. We create a transacted session by calling the below method on ConnectionFactory class and passing “JMSContext.SESSION_TRANSACTED” as session mode. public JMSContext createContext(int…… Continue reading Sending JMS messages in a Transaction

ExceptionClassifierSkipPolicy example

In this post under Spring Batch, I will explain with an example how to use Spring Batch provided ExceptionClassifierSkipPolicy class. ExceptionClassifierSkipPolicy will not contain the logic of how to handle exceptions when thrown. Instead it is a delegator class which passes the exceptions thrown to appropriate exception handling SkipPolicy classes. ExceptionClassifierSkipPolicy will contain a map…… Continue reading ExceptionClassifierSkipPolicy example