Results 1 to 4 of 4

Thread: MessageTemplate, Spring 3 and Threads

  1. #1

    Default MessageTemplate, Spring 3 and Threads

    Hi,
    I'm facing a problem after the migration from Spring 2.5, Flex 3.5 and Java 6 to Spring 3.1, Flex 4.5 and Java 7. I've declared a ClientFeed in order to send a sort of "alarm" messages to the flex client. There are three methods those alarms are sent. The first one is via snmp traps, a thread is started and wait for any trap, as one is received an alarm will be sent. The second method is via a polling mechanism, at the beginning of the web application a thread is started and will poll after a constant amount of time the alarms and send them to the client. The third method is the explicit poll command from the user, this will call a specific function on the dedicated service. This function uses then the same algorithm used in the second methods to perform a poll and shall send those alarms to the client.

    The problem is that after the migration the first two methods are working without a problem, but the third one doesn't. I suspect there is a relation with the threads. Is there any known issue between messagetemplate and the threads with the new frameworks ?

    Here is a snapshot of the used client feed:

    Code:
    @Component
    public class ClientFeed {
    
        private MessageTemplate messageTemplate;
        
        @Autowired
        public void setTemplate(MessageTemplate messageTemplate) {
            this.messageTemplate = messageTemplate;
        }
    
        public void sendAlarmUpdate(final Alarm myAlarm) {
    
            if (messageTemplate != null) {
                System.out.println("Debug Thread: " + Thread.currentThread().getName());
                messageTemplate.send(new AsyncMessageCreator() {
    
                    public AsyncMessage createMessage() {
                        AsyncMessage msg = messageTemplate.createMessageForDestination("flexClientFeed");
                        msg.setHeader("DSSubtopic", "Alarm");
                        msg.setBody(myAlarm);
    
                        return msg;
                    }
                });    
            }
        }
    }
    By the three methods I reach this piece of code and the displayed thread name are respectively: "Thread-14", "Thread-24" and "http-bio-80-exec-10".

    Thanks in advance

  2. #2
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    You've posted on the wrong forum. This forum is for Spring Integration project.

  3. #3

    Default

    Sorry, I thought that also part of the integration. I also updated BlazeDS to the 4th version.
    Can you tell me on which forum should I post this thread ?

  4. #4
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    Try http://forum.springsource.org/forumdisplay.php?61-Flex or http://stackoverflow.com/ since I am not sure if its Spring related or something else

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •