diff --git a/workshops/oracleAQ/qJava/pom.xml b/workshops/oracleAQ/qJava/pom.xml index f25798bf7..df4e571e8 100644 --- a/workshops/oracleAQ/qJava/pom.xml +++ b/workshops/oracleAQ/qJava/pom.xml @@ -10,10 +10,10 @@ com.examples - aqJava + qJava 0.0.1-SNAPSHOT java - AQ workshop + AQ/TxEventQ java workshop 8 21.1.0.0 diff --git a/workshops/oracleAQ/qJava/src/main/java/com/examples/config/ConstantName.java b/workshops/oracleAQ/qJava/src/main/java/com/examples/config/ConstantName.java index 675ff8402..6fa72bad6 100644 --- a/workshops/oracleAQ/qJava/src/main/java/com/examples/config/ConstantName.java +++ b/workshops/oracleAQ/qJava/src/main/java/com/examples/config/ConstantName.java @@ -8,7 +8,7 @@ public class ConstantName { //AQ- Point to Point public String aq_createTable = "JAVA_QUEUE_TABLE"; - public String aq_creaTxEventQueue = "JAVA_QUEUE"; + public String aq_createQueue = "JAVA_QUEUE"; public String aq_enqueueDequeueTable= "JAVA_ENQUEUE_DEQUEUE_QUEUE_TABLE"; public String aq_enqueueDequeueQueue= "JAVA_ENQUEUE_DEQUEUE_QUEUE"; @@ -22,8 +22,8 @@ public class ConstantName { public String aq_pubSubSubscriber1 = "JAVA_AQ_PUBSUB_SUBSCRIBER1"; //TxEventQ- PUBSUB - public String TxEventQ_pubSubQueue = "JAVA_TxEventQ_PUBSUB_QUEUE"; - public String TxEventQ_pubSubSubscriber1 = "JAVA_TxEventQ_PUBSUB_SUBSCRIBER1"; + public String txEventQ_pubSubQueue = "JAVA_TxEventQ_PUBSUB_QUEUE"; + public String txEventQ_pubSubSubscriber1 = "JAVA_TxEventQ_PUBSUB_SUBSCRIBER1"; //AQ- WORKFLOW public String aq_userQueueTable = "JAVA_AQ_USER_QUEUE_TABLE"; @@ -42,17 +42,17 @@ public class ConstantName { public String aq_applicationDelivererSubscriber = "JAVA_AQ_APPLICATION_DELIVERER_SUBS"; //TxEventQ- WORKFLOW - public String TxEventQ_userQueueName = "JAVA_TxEventQ_USER_QUEUE"; - public String TxEventQ_userApplicationSubscriber = "JAVA_TxEventQ_USER_APPLICATION_SUBS"; - public String TxEventQ_userDelivererSubscriber = "JAVA_TxEventQ_USER_DELIVERER_SUBS"; + public String txEventQ_userQueueName = "JAVA_TxEventQ_USER_QUEUE"; + public String txEventQ_userApplicationSubscriber = "JAVA_TxEventQ_USER_APPLICATION_SUBS"; + public String txEventQ_userDelivererSubscriber = "JAVA_TxEventQ_USER_DELIVERER_SUBS"; - public String TxEventQ_delivererQueueName = "JAVA_TxEventQ_DELIVERER_QUEUE"; - public String TxEventQ_delivererApplicationSubscriber= "JAVA_TxEventQ_DELIVERER_APPLICATION_SUBS"; - public String TxEventQ_delivererUserSubscriber = "JAVA_TxEventQ_DELIVERER_USER_SUBS"; + public String txEventQ_delivererQueueName = "JAVA_TxEventQ_DELIVERER_QUEUE"; + public String txEventQ_delivererApplicationSubscriber= "JAVA_TxEventQ_DELIVERER_APPLICATION_SUBS"; + public String txEventQ_delivererUserSubscriber = "JAVA_TxEventQ_DELIVERER_USER_SUBS"; - public String TxEventQ_applicationQueueName = "JAVA_TxEventQ_APPLICATION_QUEUE"; - public String TxEventQ_applicationUserSubscriber = "JAVA_TxEventQ_APPLICATION_USER_SUBS"; - public String TxEventQ_applicationDelivererSubscriber= "JAVA_TxEventQ_APPLICATION_DELIVERER_SUBS"; + public String txEventQ_applicationQueueName = "JAVA_TxEventQ_APPLICATION_QUEUE"; + public String txEventQ_applicationUserSubscriber = "JAVA_TxEventQ_APPLICATION_USER_SUBS"; + public String txEventQ_applicationDelivererSubscriber= "JAVA_TxEventQ_APPLICATION_DELIVERER_SUBS"; } diff --git a/workshops/oracleAQ/qJava/src/main/java/com/examples/controller/OracleAQController.java b/workshops/oracleAQ/qJava/src/main/java/com/examples/controller/OracleAQController.java index 1d391ea24..abc62d6cc 100644 --- a/workshops/oracleAQ/qJava/src/main/java/com/examples/controller/OracleAQController.java +++ b/workshops/oracleAQ/qJava/src/main/java/com/examples/controller/OracleAQController.java @@ -10,9 +10,9 @@ import org.springframework.web.bind.annotation.RestController; import com.examples.enqueueDequeueAQ.EnqueueDequeueAQ; -import com.examples.enqueueDequeueTEQ.EnqueueDequeueTEQ; +import com.examples.enqueueDequeueTxEventQ.EnqueueDequeueTxEventQ; import com.examples.workflowAQ.WorkflowAQ; -import com.examples.workflowTEQ.WorkflowTEQ; +import com.examples.workflowTxEventQ.WorkflowTxEventQ; @RequestMapping("/oracleAQ") @RestController @@ -23,13 +23,13 @@ public class OracleAQController { EnqueueDequeueAQ enqueueDequeueAQ; @Autowired(required = true) - EnqueueDequeueTEQ enqueueDequeueTEQ; + EnqueueDequeueTxEventQ enqueueDequeueTxEventQ; @Autowired(required = true) WorkflowAQ workflowAQ; @Autowired(required = true) - WorkflowTEQ workflowTEQ; + WorkflowTxEventQ workflowTxEventQ; @GetMapping(value = "/pointToPointAQ") public Map pointToPointAQ() throws Exception { @@ -67,21 +67,21 @@ public Map pubSubAQ() throws Exception { return response; } - @GetMapping(value = "/pubSubTEQ") - public Map pubSubTEQ() throws Exception { + @GetMapping(value = "/pubSubTxEventQ") + public Map pubSubTxEventQ() throws Exception { Map response = new HashMap(); - Map responseBody= enqueueDequeueTEQ.pubSubTEQ(); + Map responseBody= enqueueDequeueTxEventQ.pubSubTxEventQ(); if (responseBody != null) { response.put("ResponseCode", "200"); - response.put("ResponseText", "TEQ PubSub execution SUCCESS ...!!!"); + response.put("ResponseText", "TxEventQ PubSub execution SUCCESS ...!!!"); response.put("ResponseBody", responseBody); } else { response.put("ResponseCode", "300"); - response.put("ResponseText", "TEQ PubSub execution FAILED ...!!!"); + response.put("ResponseText", "TxEventQ PubSub execution FAILED ...!!!"); } - System.out.println("TEQ PubSub response:" + response); + System.out.println("TxEventQ PubSub response:" + response); return response; } @@ -103,19 +103,19 @@ public Map workflowAQ() throws Exception { return response; } - @GetMapping(value = "/workflowTEQ") - public Map workflowTEQ() throws Exception { + @GetMapping(value = "/workflowTxEventQ") + public Map workflowTxEventQ() throws Exception { Map response = new HashMap(); - Map responseBody= workflowTEQ.pubSubWorkflowTEQ(); + Map responseBody= workflowTxEventQ.pubSubWorkflowTxEventQ(); if (responseBody != null) { response.put("ResponseCode", "200"); - response.put("ResponseText", "TEQ Enqueue and Dequeue execution SUCCESS ...!!!"); + response.put("ResponseText", "TxEventQ Enqueue and Dequeue execution SUCCESS ...!!!"); response.put("ResponseBody", responseBody); } else { response.put("ResponseCode", "300"); - response.put("ResponseText", "TEQ Enqueue and Dequeue execution FAILED ...!!!"); + response.put("ResponseText", "TxEventQ Enqueue and Dequeue execution FAILED ...!!!"); } System.out.println("AQ Enqueue and Dequeue response:" + response); return response; diff --git a/workshops/oracleAQ/qJava/src/main/java/com/examples/enqueueDequeueTEQ/EnqueueDequeueTEQ.java b/workshops/oracleAQ/qJava/src/main/java/com/examples/enqueueDequeueTxEventQ/EnqueueDequeueTxEventQ.java similarity index 72% rename from workshops/oracleAQ/qJava/src/main/java/com/examples/enqueueDequeueTEQ/EnqueueDequeueTEQ.java rename to workshops/oracleAQ/qJava/src/main/java/com/examples/enqueueDequeueTxEventQ/EnqueueDequeueTxEventQ.java index 8e54c646f..e85d25477 100644 --- a/workshops/oracleAQ/qJava/src/main/java/com/examples/enqueueDequeueTEQ/EnqueueDequeueTEQ.java +++ b/workshops/oracleAQ/qJava/src/main/java/com/examples/enqueueDequeueTxEventQ/EnqueueDequeueTxEventQ.java @@ -1,4 +1,4 @@ -package com.examples.enqueueDequeueTEQ; +package com.examples.enqueueDequeueTxEventQ; import java.sql.SQLException; import java.util.HashMap; @@ -18,7 +18,7 @@ @Service -public class EnqueueDequeueTEQ { +public class EnqueueDequeueTxEventQ { @Autowired(required=true) private pubSubUtil pubSubUtil; @@ -29,13 +29,13 @@ public class EnqueueDequeueTEQ { @Autowired(required = true) private ConstantName constantName; - public Map pubSubTEQ() throws JsonProcessingException, ClassNotFoundException, SQLException, JMSException { + public Map pubSubTxEventQ() throws JsonProcessingException, ClassNotFoundException, SQLException, JMSException { Map response = new HashMap(); TopicSession session = configData.topicDataSourceConnection(); response.put(1, "Topic Connection created."); - pubSubUtil.pubSub(session, constantName.teq_pubSubSubscriber1, constantName.teq_pubSubQueue, "Sample text message"); + pubSubUtil.pubSub(session, constantName.txEventQ_pubSubSubscriber1, constantName.txEventQ_pubSubQueue, "Sample text message"); response.put(2, "Topic pubSub executed."); return response; diff --git a/workshops/oracleAQ/qJava/src/main/java/com/examples/util/pubSubUtil.java b/workshops/oracleAQ/qJava/src/main/java/com/examples/util/pubSubUtil.java index 7aadc57b2..b7cd4183d 100644 --- a/workshops/oracleAQ/qJava/src/main/java/com/examples/util/pubSubUtil.java +++ b/workshops/oracleAQ/qJava/src/main/java/com/examples/util/pubSubUtil.java @@ -35,7 +35,7 @@ public class pubSubUtil { ObjectMapper mapper = new ObjectMapper(); - public UserDetails pubSubWorkflowTEQ(TopicSession session, String subscriberName, String queueName, UserDetails user) + public UserDetails pubSubWorkflowTxEventQ(TopicSession session, String subscriberName, String queueName, UserDetails user) throws JsonProcessingException, ClassNotFoundException, SQLException, JMSException { Topic topic = ((AQjmsSession) session).getTopic(username, queueName); diff --git a/workshops/oracleAQ/qJava/src/main/java/com/examples/workflowTEQ/WorkflowTEQ.java b/workshops/oracleAQ/qJava/src/main/java/com/examples/workflowTxEventQ/WorkflowTxEventQ.java similarity index 81% rename from workshops/oracleAQ/qJava/src/main/java/com/examples/workflowTEQ/WorkflowTEQ.java rename to workshops/oracleAQ/qJava/src/main/java/com/examples/workflowTxEventQ/WorkflowTxEventQ.java index f7fc7172c..c0d2e3388 100644 --- a/workshops/oracleAQ/qJava/src/main/java/com/examples/workflowTEQ/WorkflowTEQ.java +++ b/workshops/oracleAQ/qJava/src/main/java/com/examples/workflowTxEventQ/WorkflowTxEventQ.java @@ -1,4 +1,4 @@ -package com.examples.workflowTEQ; +package com.examples.workflowTxEventQ; import java.sql.SQLException; import java.util.HashMap; @@ -33,7 +33,7 @@ import oracle.ucp.jdbc.PoolDataSourceFactory; @Service -public class WorkflowTEQ { +public class WorkflowTxEventQ { @Autowired UserDetailsDao userDetailsDao; @@ -59,7 +59,7 @@ public class WorkflowTEQ { UserDetails applicationToUser_message; UserDetails applicationToDeliverer_message; - public Map pubSubWorkflowTEQ() throws JMSException, SQLException, ClassNotFoundException, JsonMappingException, JsonProcessingException, AQException { + public Map pubSubWorkflowTxEventQ() throws JMSException, SQLException, ClassNotFoundException, JsonMappingException, JsonProcessingException, AQException { String deliveryStatus; Map response = new HashMap(); @@ -68,13 +68,13 @@ public Map pubSubWorkflowTEQ() throws JMSException, SQLException response.put(1, "Topic Connection created."); /* 1: USER PLACED OREDER ON APPLICATION */ - userToApplication_message = pubSubUtil.pubSubWorkflowTEQ(session, constantName.teq_userApplicationSubscriber, constantName.teq_userQueueName,new UserDetails(rnd.nextInt(99999), "DBUSER", 0, "Pending", "US")); + userToApplication_message = pubSubUtil.pubSubWorkflowTxEventQ(session, constantName.txEventQ_userApplicationSubscriber, constantName.txEventQ_userQueueName,new UserDetails(rnd.nextInt(99999), "DBUSER", 0, "Pending", "US")); response.put(2,"USER ORDER MESSAGE - ORDERID: " + userToApplication_message.getOrderId() + ", OTP: " + userToApplication_message.getOtp() + ", DeliveryStatus: " + userToApplication_message.getDeliveryStatus()); /* 2: APPLICATION SHARES OTP TO USER */ - applicationToUser_message = pubSubUtil.pubSubWorkflowTEQ(session, constantName.teq_applicationUserSubscriber, constantName.teq_applicationQueueName, + applicationToUser_message = pubSubUtil.pubSubWorkflowTxEventQ(session, constantName.txEventQ_applicationUserSubscriber, constantName.txEventQ_applicationQueueName, new UserDetails(userToApplication_message.getOrderId(), userToApplication_message.getUsername(), rnd.nextInt(9999), userToApplication_message.getDeliveryStatus(), userToApplication_message.getDeliveryLocation())); @@ -88,14 +88,14 @@ public Map pubSubWorkflowTEQ() throws JMSException, SQLException response.put(4,"APPLICATION ADDED USER ORDER INTO RECORD"); /* 4: APPLICATION SHARES DELIVERY DETAILS TO DELIVERER */ - applicationToDeliverer_message = pubSubUtil.pubSubWorkflowTEQ(session, constantName.teq_applicationDelivererSubscriber, constantName.teq_applicationQueueName, + applicationToDeliverer_message = pubSubUtil.pubSubWorkflowTxEventQ(session, constantName.txEventQ_applicationDelivererSubscriber, constantName.txEventQ_applicationQueueName, new UserDetails(userToApplication_message.getOrderId(), userToApplication_message.getUsername(), 0, userToApplication_message.getDeliveryStatus(), userToApplication_message.getDeliveryLocation())); response.put(5,"APPLICATION TO DELIVERER MESSAGE- ORDERID: "+ applicationToDeliverer_message.getOrderId() + ", OTP: " + applicationToDeliverer_message.getOtp()+ ", DeliveryStatus: " + applicationToDeliverer_message.getDeliveryStatus()); /* 5: USER SHARES OTP TO DELIVERER */ - userToDeliverer_message = pubSubUtil.pubSubWorkflowTEQ(session, constantName.teq_userDelivererSubscriber, constantName.teq_userQueueName, + userToDeliverer_message = pubSubUtil.pubSubWorkflowTxEventQ(session, constantName.txEventQ_userDelivererSubscriber, constantName.txEventQ_userQueueName, new UserDetails(applicationToUser_message.getOrderId(), applicationToUser_message.getUsername(), applicationToUser_message.getOtp(), applicationToUser_message.getDeliveryStatus(), applicationToUser_message.getDeliveryLocation())); @@ -103,7 +103,7 @@ public Map pubSubWorkflowTEQ() throws JMSException, SQLException System.out.println(); /* 6: DELIVERER TO APPLICATION FOR OTP VERIFICATION */ - delivererToApplication_message = pubSubUtil.pubSubWorkflowTEQ(session, constantName.teq_delivererApplicationSubscriber, constantName.teq_delivererQueueName, + delivererToApplication_message = pubSubUtil.pubSubWorkflowTxEventQ(session, constantName.txEventQ_delivererApplicationSubscriber, constantName.txEventQ_delivererQueueName, new UserDetails(userToDeliverer_message.getOrderId(), userToDeliverer_message.getUsername(), userToDeliverer_message.getOtp(), userToDeliverer_message.getDeliveryStatus(), userToDeliverer_message.getDeliveryLocation())); @@ -128,12 +128,12 @@ public Map pubSubWorkflowTEQ() throws JMSException, SQLException UserDetails updatedData = userDetailsDao.getUserDetails(delivererToApplication_message.getOrderId()); /* 8: APPLICATION UPDATE DELIVERER TO DELIVER ORDER */ - applicationToDeliverer_message = pubSubUtil.pubSubWorkflowTEQ(session, constantName.teq_applicationDelivererSubscriber, constantName.teq_applicationQueueName, + applicationToDeliverer_message = pubSubUtil.pubSubWorkflowTxEventQ(session, constantName.txEventQ_applicationDelivererSubscriber, constantName.txEventQ_applicationQueueName, new UserDetails(delivererToApplication_message.getOrderId(), delivererToApplication_message.getUsername(), delivererToApplication_message.getOtp(), updatedData.getDeliveryStatus(), delivererToApplication_message.getDeliveryLocation())); response.put(9, "UPDATE DELIVERER MESSAGE - ORDERID: " + applicationToDeliverer_message.getOrderId()+ ", OTP: " + applicationToDeliverer_message.getOtp() + ", DeliveryStatus: "+ applicationToDeliverer_message.getDeliveryStatus()); /* 9: APPLICATION UPDATE USER FOR DELIVERED ORDER */ - applicationToUser_message = pubSubUtil.pubSubWorkflowTEQ(session, constantName.teq_applicationUserSubscriber, constantName.teq_applicationQueueName, + applicationToUser_message = pubSubUtil.pubSubWorkflowTxEventQ(session, constantName.txEventQ_applicationUserSubscriber, constantName.txEventQ_applicationQueueName, new UserDetails(delivererToApplication_message.getOrderId(), delivererToApplication_message.getUsername(), delivererToApplication_message.getOtp(), updatedData.getDeliveryStatus(), delivererToApplication_message.getDeliveryLocation())); response.put(10, "UPDATE USER MESSAGE - ORDERID: " + applicationToUser_message.getOrderId() + ", OTP: "+ applicationToUser_message.getOtp() + ", DeliveryStatus: "+ applicationToUser_message.getDeliveryStatus()); diff --git a/workshops/oracleAQ/setup.sh b/workshops/oracleAQ/setup.sh index 5d80f5102..3bce55d13 100644 --- a/workshops/oracleAQ/setup.sh +++ b/workshops/oracleAQ/setup.sh @@ -19,7 +19,7 @@ export ORACLEAQ_PYTHON_TxEventQ=${ORACLEAQ_HOME}/qPython/txEventQ export ORACLEAQ_NODE_AQ=${ORACLEAQ_HOME}/qNode/aq export ORACLEAQ_NODE_TxEventQ=${ORACLEAQ_HOME}/qNode/txEventQ -export ORACLEAQ_JAVA=${ORACLEAQ_HOME}/aqJava +export ORACLEAQ_JAVA=${ORACLEAQ_HOME}/qJava export TNS_ADMIN=$ORACLEAQ_HOME/wallet export USER_DEFINED_WALLET=${TNS_ADMIN}/user_defined_wallet @@ -216,11 +216,11 @@ export JDBC_URL=jdbc:oracle:thin:@${DB_ALIAS}?TNS_ADMIN=${TNS_ADMIN_FOR_JAVA} #Build java code cd ../ -cd aqJava +cd $ORACLEAQ_JAVA { mvn clean install -Dmaven.wagon.http.ssl.insecure=true -Dmaven.test.skip=true cd target - nohup java -jar aqJava-0.0.1-SNAPSHOT.jar & + nohup java -jar qJava-0.0.1-SNAPSHOT.jar & } &>/dev/null echo "Java setup completed."