Results 1 to 7 of 7

Thread: JMS messages in a Web application

  1. #1
    Join Date
    Mar 2010
    Posts
    383

    JMS messages in a Web application

    Hello,
    I try to train me to JMS and their relationship with JSP. I created a small client that sends messages to a JMS MessageDriverBean under JBoss 4 which receives the good with the method onMessage (). So far, so good. The messages are consumed and destroyed. Now I would like to display these messages in a JSP without having to persist in the DB. Basically, my web application "subscribe" to the client that sends messages. Should I go through a 2nd line? The MessageDriverBean there a utility in this scenario? I have difficulty understanding the architecture in this problem. If you have any ideas, thank you in advance.

  2. #2
    Join Date
    Dec 2009
    Posts
    211

    Re: JMS messages in a Web application

    The Web application uses the message in the queue. There is only one consumer per message. In this case, the MDB would be a consumer competitor. I guess I am correct here.

  3. #3
    Join Date
    Mar 2010
    Posts
    383

    Re: JMS messages in a Web application

    I delete my message delivery Bean, I have a client who wrote a TextMessage and my JSP val read my TextMessage, but when read it, I receive

    Code:
    java.lang.ClassCastException: org.jboss.sqm.SpyObjectMessage Can not Be cast to javax.jms.TextMessage
    I have seen on the net that there is going to set but I have trouble finding the info, because for me the post of customer and consumer TextMessage TextMessage bed, apparently is not so simple.

  4. #4
    Join Date
    Nov 2009
    Posts
    343

    Re: JMS messages in a Web application

    Here is the code that can help you

    Code:
    public void sendMessage() throws JMSException, NamingException, InterruptedException (
    		/ / Rcupration context
    		Properties test = new Properties(); test.could(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); test.could(Context.URL_PKG_PREFIXES, "jboss.naming: org.jnp.interfaces"); test.could(Context.PROVIDER_URL, "JNP: / / localhost: 1099"); InitialContext temp = new javax.naming.InitialContext(test),
     
    		/ / institution Connection and rcupration a director at the tail target
    		QueueConnectionFactory queueCnxFactory = (QueueConnectionFactory)temp.lookup("ConnectionFactory"); QueueConnection que = queueCnxFactory.createQueueConnection(); queses queses = que.createQueueSession(false, queses.AUTO_ACKNOWLEDGE); quesmd quesmd = queses.createSender((Queue)temp.lookup("queue / MDBReceiveQueue")); que.start(); TextMessage tms = queses.createTextMessage(); tms.setText("Hello"); quesmd.send(tms);
    		
    		/ / Closing sessions and connections
    		quesmd.close(); que.stop(); queses.close(); que.close();
    	)

  5. #5
    Join Date
    Mar 2010
    Posts
    383

    Re: JMS messages in a Web application

    It works. Indeed, there were lots of messages in the queue. I redeployed my MDB who undertook to clear the tail. Then I removed it, handed over a message in the queue and that the JSP has been recovered. Than you for your help.

  6. #6
    Join Date
    Dec 2009
    Posts
    192

    Re: JMS messages in a Web application

    I have a problem with sending messages to a JMS Message Broker, JBOSS. The application that is sending the messages is not used in JBoss and ActiveMQ. When I send messages to an ActiveMQ broker everything works when I'm with a client on JBOSS JBOSS JMS messages, send everything works. Only the two parts I can not connect with each other.

  7. #7
    Join Date
    Nov 2009
    Posts
    45

    Re: JMS messages in a Web application

    Then JMS API standard is interoperable yes, but not the actual protocol implementations of JBoss MQ Message Broker, a wonderful client can communicate with a JBoss MQ, because they speak the same binary log, another Message Broker but uses a different shelf in the binary log. The remedy here such as the text-based messaging protocols Stomp

Similar Threads

  1. Messages application crashes in HTC Incredible S
    By FullTimepass in forum Portable Devices
    Replies: 3
    Last Post: 02-12-2011, 03:37 AM
  2. Replies: 7
    Last Post: 05-09-2011, 10:37 PM
  3. Replies: 5
    Last Post: 16-07-2011, 08:12 PM
  4. Replies: 6
    Last Post: 08-03-2011, 10:07 AM
  5. Best application available to save messages on iphone
    By Jezriah in forum Portable Devices
    Replies: 4
    Last Post: 19-12-2010, 09:56 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,302,577.72857 seconds with 17 queries