3 Replies Latest reply on Nov 10, 2006 1:11 PM by Kurt Stam

    BankLoanBrokerDemo - JMS replies not being processed +

    Bob Smith Newbie

      Hello

      I am running the bankloanbrokerdemo. I am using all the correct versions mentioned in other posts.

      I also made the changes to bankloanbrokerdemo\build.xml to change references to ${org.jboss.soa.esb.samples.loanbroker.esb_home}/build/dist/lib to ${org.jboss.soa.esb.samples.loanbroker.esb_home}/lib as I saw this mentioned in another post.
      I have also amended conf/LoanBrokerConfig.xml
      Changed:
      loanbrokerRequestDir="/temp/bankInput"
      loanbrokerEmailTemplatePath="/cygwin/home/kstam/dev1.6/loanbrokerdemo/template"
      to:
      loanbrokerEmailTemplatePath="/dev/esb/docs/samples/trailblazer/bankloanbrokerdemo/template?
      loanbrokerRequestDir="/dev/esb/docs/samples/trailblazer/bankloanbrokerdemo/pdtemp?
      To mimic what I changed the above from, I did not include a drive letter in either path.

      I then started JBoss, the listener, the File bank, and the JMS bank, and entered a loan request on the JSP.

      The JMS bank reported that it had received a request on queue C. It is configured (via bank.properties) to send replies on queue/D. What is supposed to pick that reply up? I assume it's the "listener"? The listener did not show any activity. Here is the output from the JMS bank console window:

       [java] Listening to Queue 'queue/C'.
       [java] Responding to Queue 'queue/D'.
       [java] 10:39:02,598 INFO [ManagerJMS] Looking up queue=queue/C
       [java] 10:39:03,520 INFO [ManagerJMS] Looking up connection factory
       [java] 10:39:03,629 INFO [ManagerJMS] Creating connection
       [java] 10:39:03,739 INFO [ManagerJMS] Creating session
       [java] 10:44:04,286 INFO [ManagerJMS] Got message: SpyTextMessage {
       [java] Header {
       [java] jmsDestination : QUEUE.C
       [java] jmsDeliveryMode : 2
       [java] jmsExpiration : 0
       [java] jmsPriority : 4
       [java] jmsMessageID : ID:52-11628962439421
       [java] jmsTimeStamp : 1162896243942
       [java] jmsCorrelationID: null
       [java] jmsReplyTo : null
       [java] jmsType : null
       [java] jmsRedelivered : false
       [java] jmsProperties : {JMSXDeliveryCount=1}
       [java] jmsPropReadWrite: false
       [java] msgReadOnly : true
       [java] producerClientId: ID:52
       [java] }
       [java] Body {
       [java] text :<org.jboss.soa.esb.samples.loanbroker.banks.BankQuoteRequest>
       [java] <ssn>1234567890</ssn>
       [java] <creditScore>0</creditScore>
       [java] <historyLength>0</historyLength>
       [java] <loanAmount>1000</loanAmount>
       [java] <loanTerm>12</loanTerm>
       [java] <customerUID>10501301</customerUID>
       [java] </org.jboss.soa.esb.samples.loanbroker.banks.BankQuoteRequest>
       [java] }
       [java] }
       [java] 10:44:05,004 INFO [Bank] Bank 'JMSBasedBank' received a request for
       SSN=1234567890 for $1000 over 12 months.
       [java] 10:44:05,051 INFO [Bank] Bank 'JMSBasedBank offers SSN=1234567890 BankQuoteReply=[interestRate=8.60, quoteId=JMSBasedBank-0, errorCode=0, customerU
      ID=10501301]
       [java] 10:44:05,098 INFO [ManagerJMS] Looking up connection factory
       [java] 10:44:05,129 INFO [ManagerJMS] Creating connection
       [java] 10:44:05,145 INFO [ManagerJMS] Creating session
      

      There is no more output after this point.

      The File bank's console showed no activity at all. After submitting the request on the jsp I noticed that a file appeared in the loanbrokerRequestDir (which is set in LoanBrokerConfig.xml) folder. I decided to see what would happen if I manually dropped the file into the file.monitored.directory - the File bank kicked into life, the file was moved to <file.monitored.directory>/processed. The listener also kicked into life, reporting an error sending e-mail. The error stated that org.jboss.soa.esb.mail.smtp.from was invalid. This is set to a string "FromMe" as I didn't think that that would need to be a valid e-mail account, rather just who the e-mail would appear to be from, whith the actual account the e-mail was from being defined by the value of org.jboss.soa.esb.mail.smtp.user.
      The listener also tells me that the value of org.jboss.soa.esb.mail.smtp.auth is blank, but the conf/LoanBrokerConfig.xml file has, under EmailProperties,
      org.jboss.soa.esb.mail.smtp.auth="true".

      So, in summary, I have 4 questions:
      (1) Why did I manually need to move the file for the File Bank to work? Is there something I have configured incorrectly?
      (2) Does org.jboss.soa.esb.mail.smtp.from need to be set to a valid e-mail account?
      (3) Why is the Listener reporting that org.jboss.soa.esb.mail.smtp.auth is not set when it is?
      (4) Why doesn't the listener process the reply from the JMS bank? Or why doesn't the JMS bank send the reply?

      Thanks,
      Bob

        • 1. Re: BankLoanBrokerDemo - JMS replies not being processed +
          Kurt Stam Master

          Hi Bob,

          Looks like you took a thorough look at it. Good work :).

          You can use drive letters, I use cygwin which is why I excluded them. If all your stuff is on the same drive you can omit the drive letter, otherwise you will need it.

          (1) Why did I manually need to move the file for the File Bank to work? Is there something I have configured incorrectly?

          Yes it is likely the loanbroker is not dropping the file in the right directory. Check this setting: loanbrokerRequestDir="/temp/bankInput"

          (2) Does org.jboss.soa.esb.mail.smtp.from need to be set to a valid e-mail account?

          Yes, your ISP won't accept an email message with an invalid replyTo, so we do some basic checking before sending it into cyberspace.

          (3) Why is the Listener reporting that org.jboss.soa.esb.mail.smtp.auth is not set when it is?

          I don't know. This maybe a bug. I'll make a not of that. If you are sure it's bug please log a bug in jira.

          (4) Why doesn't the listener process the reply from the JMS bank? Or why doesn't the JMS bank send the reply?

          It should, nothing happens (compilation of the email) until it also receives a response from the FileBank. It may be that logging is sparse.

          Well I hope this helps.

          --Kurt

          • 2. Re: BankLoanBrokerDemo - JMS replies not being processed +
            Bob Smith Newbie

            Hi Kurt,

            Thank you for your reply. I've had a bit of time this afternoon to have a look at this again.

            I enter a loan request via the jsp. That results in the RequestLoan web service method being called (LoanBrokerWS.java). The RequestLoan method puts a loan request on queue/A. The JMS bank is listening on queue/A, takes the request off, "processes" it, and puts a reply on queue/B.

            Q1 - What is listening on queue/B? Perhaps that is the purpose of the "Listener" (I haven't looked at any of that code yet, and maybe if I did then it'd answer some of my own questions :))?

            You told me to check the value of loanbrokerRequestDir. I mentioned what that was in my original post. When I entered a Loan Request, a text file appeared in that directory. However, the File Based Bank appears to monitor the folder specified by the value of file.monitored.directory in bank.properties, and so does not pick up the file until it is manually copied from loanbrokerRequestDir to file.monitored.directory.
            Q2 - Is that a bug?

            Q3 - I can't see what created the file that appeared in loanbrokerRequestDir. Could you point me in the direction of the code that did that, and maybe tell me when in the process it was created?

            The RequestLoan WS method persists the Customer. This is the only ESB related method I can find in this whole process - and all it does is persist the Customer.
            Q4 - Where is the ESB / what functionality and benefits is it bringing? I'm obviously missing the point somewhere as I can't see anything in the example that I haven't had for 6 years - a bit of JMS and some hard-coded format converter.

            I'm going to continue looking for a bit longer, but if you do get a minute to answer the above 4 questions then it'd be most appreciated.


            Many Thanks,
            Bob

            • 3. Re: BankLoanBrokerDemo - JMS replies not being processed +
              Kurt Stam Master

              Hi Bob,

              I attached a pdf:
              http://wiki.jboss.org/wiki/attach?page=Trailblazer4.0Beta1%2FLoanBrokerArchitecture.pdf
              on the jboss esb wiki
              http://wiki.jboss.org/wiki/Wiki.jsp?page=Trailblazer4.0Beta1

              Maybe that helps things out on Q1.

              A2. No this is not a bug, plenty user before got this to work. I think you have something misconfigured.

              A3. The Loanbroer Listener is where you should be looking.

              A4. Our ESB provides services that all listen on the same message bus. See also http://labs.jboss.com/portal/jbossesb/resources/index.html. I think you will have to pick up a book like http://www.enterpriseintegrationpatterns.com/ or
              http://www.amazon.com/Enterprise-Service-Oriented-Architectures-Recommendations/dp/140203704X
              Once you get the concept of the architecture it will all start making sense.
              Watch some of the free webinars: http://www.jboss.com/products/esb

              The ESB is not new 'technology' (the way you use it), it is more a new architecture (which is still new technology :)). The JBossESB is a product that will help you achieve that integration architecture with minimal effort, and reducing the complexity of maintenance going forward. The (very) soon to be released RC will have a lot more services. We are also working on a brand new loanbroker, so suggestions on what you learn will be incorporated in the new one.

              Anyway, I hope you get your config straightened out soon. Don't hesitate to ask more questions.

              Cheers,

              --Kurt