mercredi 26 février 2020

Monitor Job Status in Wildfly Cluster using Apache Camel

Route 1:

  • File Read in Route 1: Status to DB = STARTED
  • File contents Splitted (Employees : Count around 20,000)
  • Contents put onto a Queue.

Route 2

  • Read from Queue in Cluster (Wildfly 16.
  • Insert or Update Employee

Now need to build a Status table with Success and Faliure Status. If any message fail then STATUS = FAILED else STATUS = STARTED

Route 1:

 .split(body().tokenizeXML("EmploymentUpdateRequest", "EmploymentUpdateRequests")) // Split and tokenize the requests, streaming individual requests to message queue
                .unmarshal(new JaxbDataFormat(JAXBContext.newInstance(EmploymentUpdateRequest.class)))
                .bean("someService", "updateEmployeeData")
                .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 Master")
                .bean("employeeService", "extract")
                .log("Verifying whether Data is correct or not")
                .bean("employeeService", "verifyExchange")
                .log("Persisting data to Master")
                .bean("employeeService", "save");

Any suggestion to achieve this in Camel deployed in Cluster wildfly which picks messages randomly like 7000 one server picks 10000 1 picks?

Aucun commentaire:

Enregistrer un commentaire