Announcement Announcement Module
No announcement yet.
spring integration - jms Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • spring integration - jms

    i started working with spring integration few days ago ,excuse for my noob question.
    i wrote a code that uses jms:inbound-channel-adapter that pass the messages to a chanel and i have a service-activator that takes that message and save it.

    My problem is that I want to add a functionality of sending a message to the jms server every XX time, (this message can be a constant) .
    i tried doing this in different ways but unfortunately i cant find out how to do this basic ...
    i would really be gr8ful ,
    if someone here can help me.

  • #2
    You could use something like

    <inbound-channel-adapter id="myChannelAdapter"
    		ref="myBean" method="generateMessage">
    		<poller max-messages-per-poll="1">
    			<interval-trigger interval="30" time-unit="SECONDS" />
    which will fire every time the poller interval expires, call a method on your bean which will return the message to an implicit direct channel named after the id. In this case "myChannelAdapter". You can then use jms:outbound-channel-adapter to consume the channel and send the message to your JMS destination.

    <si-jms:outbound-channel-adapter id="jmsOutbound"
    		destination="myDestination" channel="myChannelAdapter" />


    • #3
      e-mail spring-integration

      Thank you very much rhart for your reply, it is working and easy to implement.
      i have another question hope you can help, about the mail:inbound-channel-adapter
      i used it first for my gmail account for testing and it is working well,
      then i tried to use it on my client mail domain and i get an authenticationException , the username and password are good ofcourse.

      the username in that domain contains a domain name
      for example :
      store-uri="pop3://[email protected][email protected]_ADRESS:110"
      as you can see there are 2 "@", 1 for the username, second for the ip.
      i was wondering , maybe spring integration cant deal with mail servers that contain their domain names in their username.

      semi conclusion: ..., gmail worked and this client mail didnt.
      is there a problem with usernames with @ domains in their names?

      here is the exception:
      Caused by: javax.mail.AuthenticationFailedException
      at javax.mail.Service.connect(
      at javax.mail.Service.connect(
      at javax.mail.Service.connect(
      at org.springframework.integration.mail.AbstractMailR eceiver.openSession(
      at org.springframework.integration.mail.AbstractMailR eceiver.openFolder(
      at org.springframework.integration.mail.AbstractMailR eceiver.receive(
      ... 13 more
      Thanks you again.
      Last edited by ok2b; Aug 16th, 2009, 09:04 AM.


      • #4
        I havnt really used the mail support but would the uri be more like "pop3://domain\username: [email protected]: port". Have you tried that? or a "/" instead of the "\". Do you know for sure it should be using "@"? If so have you tried using the escape character instead "& #64;"


        • #5
          solution found

          I tried all the variations that you have mentioned and it didnt work out.
          i figured how to fix this problem and i will share it here for others who are interesting also.
          if you havea username+domain with the "@" character , just replace it with %40, so it looks like this:
          pop3://username%40domain[email protected]ort/INBOX
          i appreciate your help rhart and i find this forum very contributing.