DigestOutputStream Class Example

In this post under Java –> Security, I will explain with example the use of DigestOutputStream class. When any stream class under java.io package is used, the data flows from source to destination in a stream. DigestOutputStream class can be used to calculate a Message Digest when data is being written to the destination using…… Continue reading DigestOutputStream Class 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