javax.mail.Authenticator Example

javax.mail.Authenticator Example In this post under Java Mail, I will explain the use of Authenticator abstract class with an example. Note: For this example and other examples in future we need to have1) Gmail account2) GMail SMTP server address3) Stop the antivirus software running on your local.4) Create an application password. The steps are mentioned…… Continue reading javax.mail.Authenticator Example

Chaining multiple ChunkListeners

In this post under Spring Batch, I will explain how to chain multiple ChunkListener together. For this example I will create two custom ChunkListener interface implementations named ‘CustomChunkListener1’ and ‘CustomChunkListener2’ as shown below CustomChunkListener1 package package35; import org.springframework.batch.core.ChunkListener; import org.springframework.batch.core.scope.context.ChunkContext; public class CustomChunkListener1 implements ChunkListener { @Override public void afterChunk(ChunkContext chunkContext) { System.out.println(“ChunkListener1 processing ended…… Continue reading Chaining multiple ChunkListeners

Chaining multiple ItemProcessorListener

In this post under Spring Batch, I will explain with example how to chain multiple ItemProcessorListeners. For our example we create two ItemProcessorListener as shown below CustomItemProcessListener1 package package34; import org.springframework.batch.core.ItemProcessListener; public class CustomItemProcessListener1 implements ItemProcessListener { @Override public void afterProcess(Employee employee1, Employee employee2) { System.out.println(“CustomItemProcessListener1: Item processing completed”); } @Override public void beforeProcess(Employee employee)…… Continue reading Chaining multiple ItemProcessorListener

CompositeItemWriter Example

In this post under Spring Batch, I will explain with example the purpose of CompositeItemWriter and how to use it. In all the previous post’s examples under Spring Batch, I have used only one writer bean. The writer bean’s job was to write the items read to a file as shown below <bean id=”writer” class=”org.springframework.batch.item.file.FlatFileItemWriter”>…… Continue reading CompositeItemWriter Example