Return-Path: Delivered-To: apmail-geronimo-activemq-users-archive@www.apache.org Received: (qmail 25728 invoked from network); 5 Sep 2006 18:52:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Sep 2006 18:52:39 -0000 Received: (qmail 56429 invoked by uid 500); 5 Sep 2006 18:52:38 -0000 Delivered-To: apmail-geronimo-activemq-users-archive@geronimo.apache.org Received: (qmail 56411 invoked by uid 500); 5 Sep 2006 18:52:38 -0000 Mailing-List: contact activemq-users-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-users@geronimo.apache.org Delivered-To: mailing list activemq-users@geronimo.apache.org Received: (qmail 56402 invoked by uid 99); 5 Sep 2006 18:52:38 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Sep 2006 11:52:38 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of lists@nabble.com designates 72.21.53.35 as permitted sender) Received: from [72.21.53.35] (HELO talk.nabble.com) (72.21.53.35) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Sep 2006 11:52:36 -0700 Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1GKg1w-0006Ll-4X for activemq-users@geronimo.apache.org; Tue, 05 Sep 2006 11:52:16 -0700 Message-ID: <6158009.post@talk.nabble.com> Date: Tue, 5 Sep 2006 11:52:16 -0700 (PDT) From: jefetech To: activemq-users@geronimo.apache.org Subject: Java sending message to listening ajax MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: info@jefetech.com X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I've got all my ajax send/receive working, however I need a java program to be able to send/receive message from the ajax. Why does the ajax not receive this? Do I need simulate a httppost instead of this? ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(BROKER_URL); //Destination destination = client.getSession(); // Create a Connection Connection connection = connectionFactory.createConnection(); connection.start(); // Create a Session Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); // Create the destination (Topic or Queue) Destination destination = session.createTopic(CHANNEL); // Create a MessageProducer from the Session to the Topic or Queue MessageProducer producer = session.createProducer(destination); producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT); // Create a messages String from = Thread.currentThread().getName(); String text = "Hello World Yo!"; //String text = "Hello world! From: " + Thread.currentThread().getName() + " : " + this.hashCode(); TextMessage message = session.createTextMessage(text); // Tell the producer to send the message System.out.println("Sent message: "+ message.hashCode() + " : " + Thread.currentThread().getName()); producer.send(message); // Clean up session.close(); connection.close(); -- View this message in context: http://www.nabble.com/Java-sending-message-to-listening-ajax-tf2222685.html#a6158009 Sent from the ActiveMQ - User forum at Nabble.com.