mercredi 22 avril 2020

Java: How to return task status (or success count) for program running in Clusters?

We send a message to Queue. There are single program deployed in 3 servers reading from the Queue.

We send 15,000 Messages and 5000 each processed by each server.

After all finish, We need to show in Log ""PROCESS ENDS"".

How can we manage it in Java?

Note: We are using Apache Camel for this but i am not able to understand to achieve it in general Java following is camel code for reference:

Route 1: .marshal(new JaxbDataFormat(JAXBContext.newInstance(EmploymentUpdateRequest.class)))
            .inOnly(EMPLOYEES_QUEUE)
                    .choice()
                    .when(header("CamelSplitComplete"))
                        .log("Download xml file completed");

ROUTE 2: from(EMPLOYEES_QUEUE)
            .unmarshal(new JaxbDataFormat(JAXBContext.newInstance(EmploymentUpdateRequest.class)))
                .log("Extracting Data from Masterdata and Mapping")
                .bean("employeeService", "extract")

Route 2 is reading from Employees queue configured in wildfly.

Aucun commentaire:

Enregistrer un commentaire