BiConsumer Example

In this post, I will show how to use BiConsumer functional interface with an example. BiConsumer functional interface is similar to Consumer functional interface. It takes an input, processes it and doesn’t return anything. The difference lies in the number of inputs taken by the BiConsumer functional interface. Consumer functional interface takes one input whereas…… Continue reading BiConsumer Example

TransportListener Example

In this post under Java Mail, I will explain with example the purpose and how to use TransportListener interface. 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 in…… Continue reading TransportListener Example

BiFunction Example

In this post, I will show how to use BiFunction functional interface with an example. BiFunction functional interface is similar to Function functional interface. It takes an input and produces an output. The difference lies in the number of inputs taken by the BiFunction functional interface. Function functional interface takes one input and produced one…… Continue reading BiFunction Example

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<Employee, Employee> { @Override public void afterProcess(Employee employee1, Employee employee2) { System.out.println(“CustomItemProcessListener1: Item processing completed”); } @Override public void beforeProcess(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