[jboss-svn-commits] JBL Code SVN: r9052 - labs/jbossesb/trunk/product/samples/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Sat Jan 27 22:07:31 EST 2007
Author: daniel.brum at jboss.com
Date: 2007-01-27 22:07:30 -0500 (Sat, 27 Jan 2007)
New Revision: 9052
Modified:
labs/jbossesb/trunk/product/samples/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanBroker.java
Log:
bug fixing
Modified: labs/jbossesb/trunk/product/samples/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanBroker.java
===================================================================
--- labs/jbossesb/trunk/product/samples/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanBroker.java 2007-01-28 03:06:44 UTC (rev 9051)
+++ labs/jbossesb/trunk/product/samples/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanBroker.java 2007-01-28 03:07:30 UTC (rev 9052)
@@ -70,9 +70,10 @@
CustomerMasterFile.addCustomer(String.valueOf(customer.ssn), customer);
//step 1 - send to credit agency for credit score if available
- //uses 2way courier for a response TODO: figure out why this does not work!
+
sendToCreditAgency(customer);
+ //added a pause here to give the creditagency some time to reply
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
@@ -81,12 +82,9 @@
}
//step 2 - send to JMS Bank - async
- sendToJMSBank(customer);
+ System.out.println("sending to JMS Bank...");
+ sendToJMSBank(customer);
- //step 3 - send to File Bank (when listener is ready)
-
- //step 4 - send to SQL Bank (when listener ready)
-
}
private Customer getCustomer(WebCustomer wCustomer) {
@@ -117,8 +115,9 @@
quote.customerEmail=customer.email;
SendJMSMessage sender = new SendJMSMessage();
- sender.setupConnection(
- ModulePropertyManager.getPropertyManager(MODULE_NAME).getProperty(JMS_BANK_QUEUE));
+ String queue = ModulePropertyManager.getPropertyManager(MODULE_NAME).getProperty(JMS_BANK_QUEUE);
+ sender.setupConnection(queue);
+ logger.debug("setting up jms connection to queue: " + queue);
logger.debug("sending text message to bank: " + quote.toString());
sender.sendAMessage(quote.getCSV());
sender.stop();
@@ -173,9 +172,10 @@
replyMessage = courier.pickup(5000); //wait for 5 seconds then give up
if (replyMessage !=null) {
logger.info("received reply from creditAgency action");
- logger.info("message received: " + new String(replyMessage.getBody().getContents()));
- System.out.println("Loanbroker credit score received of: " + replyMessage.getBody().getContents());
- score = new Integer(new String(replyMessage.getBody().getContents())).intValue();
+ logger.info("message received: " + replyMessage.getBody().getContents());
+ String xx = new String(replyMessage.getBody().getContents());
+ System.out.println("Loanbroker credit score received of: " + xx);
+ score = Integer.parseInt(xx.trim());
}else {
logger.debug("reply not received from credit agency - setting a value of 5");
score = 5;
More information about the jboss-svn-commits
mailing list