Return-Path: Delivered-To: apmail-geronimo-activemq-users-archive@www.apache.org Received: (qmail 89881 invoked from network); 4 Jan 2006 12:32:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 4 Jan 2006 12:32:55 -0000 Received: (qmail 94591 invoked by uid 500); 4 Jan 2006 12:32:54 -0000 Delivered-To: apmail-geronimo-activemq-users-archive@geronimo.apache.org Received: (qmail 94540 invoked by uid 500); 4 Jan 2006 12:32:54 -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 94488 invoked by uid 99); 4 Jan 2006 12:32:53 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Jan 2006 04:32:53 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [200.213.13.1] (HELO eserver.datacom-telematica.com.br) (200.213.13.1) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Jan 2006 04:32:51 -0800 Received: (qmail 9810 invoked by uid 89); 4 Jan 2006 12:32:38 -0000 Received: from unknown (HELO ?192.168.11.11?) (marcelo@192.168.11.11) by 0 with SMTP; 4 Jan 2006 12:32:38 -0000 Received: from 127.0.0.1 (AVG SMTP 7.1.371 [267.14.12/220]); Wed, 04 Jan 2006 10:32:33 -0200 Message-ID: <43BBC061.1040102@datacom-telematica.com.br> Date: Wed, 04 Jan 2006 10:32:33 -0200 From: Datacom - Marcelo User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: activemq-users@geronimo.apache.org, activemq-dev@geronimo.apache.org Subject: another problem with sender/subscriber Content-Type: multipart/mixed; boundary="------------020509050409090006020508" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --------------020509050409090006020508 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I just did more tests with these samples now only with windows arch. (3 computers 2 xp professional 1 2003 server). I did 2 tests one the broker runs in 2003 server and the other the broker runs in a xp professional. In both when I send a message from windows 2003 server all 3 subscribers receive that message but when a I send a message from windows XP, only the 2 windows xp receives that message. There is no firewall enabled in any computer. I'm sending a copy of this mail to devel-mailing list because I believe that may be a bug (In the code I wrote or in activemq). The only conclusion I get is that may be an architecture dependant problem as we can see in all these tests in Solaris, Win2k, XP and 2003 server. Marcelo ----------------------------------------- Hi, as I told I write 2 small classes to demonstrate what is happening here. The scenario is composed by 3 computers, one running activemq-server (last stable version) in windows 2000 professional, one running solaris 8 and ond running windows xp professional. Java 5_04 is used to run the codes. I've created a common topic, a simple selector and I'd published a message to all three subscribers from one computer at a time. Here is the results: When win 2k publishes: solaris receives, windows xp does not, win2k receives (itself) ------------------------ When solaris publishes: solaris receives (itself), windows xp does not, win2k receives ------------------ When windows xp publishes: solaris receives, windows xp receives (it self), win2k receives I sent attached the classes I used to run the tests, I may be doing something wrong but this same tests run fine with OpenJMS and they are so simple. Just have to pass the openJMS server ip as parameter and the message is published or topic subscriber. Thanks in advance, -- MARCELO Ribeiro -- MARCELO Ribeiro --------------020509050409090006020508 Content-Type: text/plain; name="Mreceiver.java" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="Mreceiver.java" //package a; import java.util.Hashtable; import javax.jms.*; import javax.naming.Context; import javax.naming.InitialContext; import org.activemq.jndi.ActiveMQInitialContextFactory; public class Mreceiver implements MessageListener { public Mreceiver (String jmsServer) { Hashtable properties = new Hashtable(); Context context; TopicConnectionFactory factory; Topic topic; TopicConnection connection; TopicSession session; TopicSubscriber tsub; String selector = "type=2"; properties.put( Context.INITIAL_CONTEXT_FACTORY, ActiveMQInitialContextFactory.class.getName()); int port = 61616; String url = null; url = "tcp://" + jmsServer + ":" + port; properties.put(Context.PROVIDER_URL, url); properties.put("topic.NMS", "NMS"); try { context = new InitialContext(properties); factory = (TopicConnectionFactory) context.lookup("ConnectionFactory"); topic = (Topic) context.lookup("NMS"); connection = factory.createTopicConnection(); session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE); tsub = session.createSubscriber(topic, selector, false); tsub.setMessageListener(this); connection.start(); } catch (Exception e) { System.out.println("Error " + e); } } /** * */ public static void main(String[] args) { String host = args[0]; System.out.println("Conectando-se ao servidor JMS em " + host); new Mreceiver(host); } public void onMessage (Message msg) { System.out.println("Message received"); } } --------------020509050409090006020508 Content-Type: text/plain; name="Msender.java" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="Msender.java" //package a; import java.util.Hashtable; import javax.jms.DeliveryMode; import javax.jms.Message; import javax.jms.Session; import javax.jms.Topic; import javax.jms.TopicConnection; import javax.jms.TopicConnectionFactory; import javax.jms.TopicPublisher; import javax.jms.TopicSession; import javax.naming.Context; import javax.naming.InitialContext; import org.activemq.jndi.ActiveMQInitialContextFactory; public class Msender { public Msender(String jmsServer) { Hashtable properties = new Hashtable(); Context context; TopicConnectionFactory factory; Topic topic; TopicConnection connection; TopicSession session; TopicPublisher publisher; properties.put( Context.INITIAL_CONTEXT_FACTORY, ActiveMQInitialContextFactory.class.getName()); int port = 61616; String url = null; url = "tcp://" + jmsServer + ":" + port; properties.put(Context.PROVIDER_URL, url); properties.put("topic.NMS", "NMS"); try { context = new InitialContext(properties); factory = (TopicConnectionFactory) context.lookup("ConnectionFactory"); topic = (Topic) context.lookup("NMS"); connection = factory.createTopicConnection(); session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE); publisher = session.createPublisher(topic); Message message = session.createMessage(); message.setStringProperty("host", "192.168.11.116"); message.setIntProperty("type", 2); publisher.publish(message, DeliveryMode.NON_PERSISTENT, 4, 3000); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } System.out.println("Sent message to server in " + jmsServer); System.exit(0); } /** * */ public static void main(String[] args) { String host = args[0]; System.out.println("Connecting in JMS server in " + host); new Msender(host); } } --------------020509050409090006020508--