Commit 723505a6 authored by Nicolas Tachker's avatar Nicolas Tachker

JORAM-140: use the clientID for the durable subscription (JMS2.0 - API...

JORAM-140: use the clientID for the durable subscription (JMS2.0 - API Clarifications - Client Identifier).
parent a95bcb4f
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2007 ScalAgent Distributed Technologies
* Copyright (C) 2007 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -63,6 +63,7 @@ public class Test_CAck1_T extends TestCase {
ictx.close();
Connection cnx = cf.createConnection();
cnx.setClientID("Test_CAck1_T");
Session sessionp = cnx.createSession(false,
Session.CLIENT_ACKNOWLEDGE);
Session sessionc = cnx.createSession(false,
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2007 ScalAgent Distributed Technologies
* Copyright (C) 2007 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -63,6 +63,7 @@ public class Test_CAck2_T extends TestCase {
ictx.close();
Connection cnx = cf.createConnection();
cnx.setClientID("Test_CAck2_T");
Session sessionp = cnx.createSession(false,
Session.CLIENT_ACKNOWLEDGE);
Session sessionc = cnx.createSession(false,
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2007 ScalAgent Distributed Technologies
* Copyright (C) 2007 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -95,6 +95,7 @@ public class Test_Exceptions extends TestCase {
tcnx.close();
Connection cnx = cf.createConnection();
cnx.setClientID("Test_Exceptions");
Session sessionp = cnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
Session sessionc = cnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
cnx.start();
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2007 ScalAgent Distributed Technologies
* Copyright (C) 2007 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -60,6 +60,7 @@ public class Test_Trans_T extends TestCase {
ictx.close();
Connection cnx = cf.createConnection();
cnx.setClientID("test_Trans_T");
Session sessionp = cnx.createSession(true,
Session.AUTO_ACKNOWLEDGE);
Session sessionc = cnx.createSession(true,
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2007 ScalAgent Distributed Technologies
* Copyright (C) 2007 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -72,6 +72,7 @@ public class BridgeTest3 extends TestCase {
MessageProducer joramSender = joramSess.createProducer(joramDest);
Connection foreignCnx = foreignCF.createConnection();
foreignCnx.setClientID("foreignCnx");
Session foreignSess = foreignCnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageConsumer foreignCons = foreignSess.createDurableSubscriber((Topic) foreignDest, "durable");
foreignCnx.start();
......@@ -107,6 +108,7 @@ public class BridgeTest3 extends TestCase {
Thread.sleep(5000);
foreignCnx = foreignCF.createConnection();
foreignCnx.setClientID("foreignCnx");
foreignSess = foreignCnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
foreignCons = foreignSess.createDurableSubscriber((Topic) foreignDest, "durable");
foreignCnx.start();
......@@ -149,6 +151,7 @@ public class BridgeTest3 extends TestCase {
Thread.sleep(5000);
foreignCnx = foreignCF.createConnection();
foreignCnx.setClientID("foreignCnx");
foreignSess = foreignCnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
foreignCons = foreignSess.createDurableSubscriber((Topic) foreignDest, "durable");
foreignCnx.start();
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2005 - 2007 ScalAgent Distributed Technologies
* Copyright (C) 2005 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -65,6 +65,7 @@ public class ClientTest16 extends TestCase {
((TcpConnectionFactory)cf).getParameters().connectingTimer = 2; //seconds
Connection connection = cf.createConnection("anonymous", "anonymous");
connection.setClientID("ClientTest16");
Session recSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2005 - 2009 ScalAgent Distributed Technologies
* Copyright (C) 2005 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -60,6 +60,7 @@ public class ClientTest16_2 extends TestCase {
((TcpConnectionFactory) cf).getParameters().cnxPendingTimer = 500;
Connection connection = cf.createConnection("anonymous", "anonymous");
connection.setClientID("ClientTest16_2");
Session recSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2012 - ScalAgent Distributed Technologies
* Copyright (C) 2012 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -86,6 +86,7 @@ public class ClientTest25 extends TestCase {
org.objectweb.joram.client.jms.tcp.TcpConnectionFactory.create("localhost", 2560);
Connection connection = cf.createConnection("anonymous", "anonymous");
connection.setClientID("ClientTest25");
connection.start();
testRedelivered(queue, connection);
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2004 - 2007 ScalAgent Distributed Technologies
* Copyright (C) 2004 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -65,6 +65,7 @@ public class Distrib_2serv_T extends TestCase {
Connection cnx = cf0.createConnection();
Connection cnxCons = cf1.createConnection();
cnxCons.setClientID("Distrib_2serv_T");
Session sessionp = cnx.createSession(false,
Session.AUTO_ACKNOWLEDGE);
Session sessionc = cnxCons.createSession(false,
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2004 - 2007 ScalAgent Distributed Technologies
* Copyright (C) 2004 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -66,6 +66,7 @@ public class Distrib_3serv_T extends TestCase {
Connection cnx = cf0.createConnection();
Connection cnxCons = cf1.createConnection();
cnxCons.setClientID("Distrib_3serv_T");
Session sessionp = cnx.createSession(false,
Session.AUTO_ACKNOWLEDGE);
Session sessionc = cnxCons.createSession(false,
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2004 - 2010 ScalAgent Distributed Technologies
* Copyright (C) 2004 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -33,14 +33,12 @@ import org.objectweb.joram.client.jms.admin.AdminModule;
import org.objectweb.joram.client.jms.admin.User;
import org.objectweb.joram.client.jms.tcp.TcpConnectionFactory;
import fr.dyade.aaa.agent.AgentServer;
/**
* Test durable subscription:
* - Create a durable subscriber with name "dursub1".
* - Create a durable subscriber with name "dursub1" and clientId "cnx1".
* - Create another durable subscriber with the same subscription name and verify
* that using an already active subscription generate an exception.
* - Close the session of the active subscriber.
* - Close the session and connection of the active subscriber.
* - Create a subscriber to the durable subscription and verify that it is ok.
* - Close the connection.
* - Create a subscriber to the durable subscription and verify that it is ok.
......@@ -68,6 +66,7 @@ public class Test1 extends framework.TestCase {
AdminModule.disconnect();
Connection cnx1 = cf.createConnection();
cnx1.setClientID("cnx1");
cnx1.start();
Session sess1 = cnx1.createSession(false, Session.AUTO_ACKNOWLEDGE);
......@@ -76,6 +75,7 @@ public class Test1 extends framework.TestCase {
Connection cnx2 = cf.createConnection();
JMSException exc = null;
try {
cnx2.setClientID("cnx1");
Session sess2 = cnx2.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageConsumer cons2 = sess2.createDurableSubscriber(topic, "dursub1");
} catch (JMSException e) {
......@@ -84,13 +84,16 @@ public class Test1 extends framework.TestCase {
assertTrue(exc != null);
sess1.close();
cnx1.close();
cnx2.setClientID("cnx1");
Session sess2 = cnx2.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageConsumer cons2 = sess2.createDurableSubscriber(topic, "dursub1");
cnx1.close();
cnx2.close();
cnx1 = cf.createConnection();
cnx1.setClientID("cnx1");
Session sess3 = cnx1.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageConsumer cons3 = sess3.createDurableSubscriber(topic, "dursub1");
} catch(Throwable exc){
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2003 - 2010 ScalAgent Distributed Technologies
* Copyright (C) 2003 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -53,6 +53,7 @@ public class Test2 extends framework.TestCase {
ConnectionFactory cf = TcpConnectionFactory.create("localhost", 2560);
((TcpConnectionFactory) cf).getParameters().connectingTimer = 10;
((TcpConnectionFactory) cf).getParameters().clientID = "Test2";
AdminModule.connect(cf, "root", "root");
User.create("anonymous", "anonymous", 0);
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2004 - 2010 ScalAgent Distributed Technologies
* Copyright (C) 2004 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -72,6 +72,7 @@ public class Test3 extends TestCase {
// Creates a connection and initializes the durable subscriber
Connection cnx2 = cf.createConnection();
cnx2.setClientID("cnx_dursub");
Session sess2 = cnx2.createSession(false, Session.AUTO_ACKNOWLEDGE);
TopicSubscriber cons = sess2.createDurableSubscriber(topic, "dursub");
cnx2.start();
......@@ -87,6 +88,7 @@ public class Test3 extends TestCase {
// reconnection of subscribe
cnx2 = cf.createConnection();
cnx2.setClientID("cnx_dursub");
sess2 = cnx2.createSession(false,Session.AUTO_ACKNOWLEDGE);
cons = sess2.createDurableSubscriber(topic, "dursub");
cnx2.start();
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2004 - 2009 ScalAgent Distributed Technologies
* Copyright (C) 2004 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -55,6 +55,7 @@ public class Test4 extends framework.TestCase {
ConnectionFactory cf = TcpConnectionFactory.create("localhost", 2560);
((TcpConnectionFactory) cf).getParameters().connectingTimer = 10;
((TcpConnectionFactory) cf).getParameters().clientID = "Test4";
AdminModule.connect(cf, "root", "root");
User.create("anonymous", "anonymous", 0);
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2004 - 2010 ScalAgent Distributed Technologies
* Copyright (C) 2004 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -65,7 +65,7 @@ public class Test5 extends TestCase {
AdminModule.disconnect();
Connection cnx1 = cf.createConnection("anonymous", "anonymous");
cnx1.setClientID("cnx_dursub1");
Session sess = cnx1.createSession(false,Session.AUTO_ACKNOWLEDGE);
MessageProducer prod = sess.createProducer(topic);
......@@ -75,7 +75,7 @@ public class Test5 extends TestCase {
cnx1.start();
Connection cnx2 = cf.createConnection("anonymous", "anonymous");
cnx2.setClientID("cnx_dursub2");
Session sess2 = cnx2.createSession(false, Session.CLIENT_ACKNOWLEDGE);
TopicSubscriber cons2 = sess2.createDurableSubscriber(topic, "dursub2");
......@@ -114,6 +114,7 @@ public class Test5 extends TestCase {
}
cnx2 = cf.createConnection("anonymous", "anonymous");
cnx2.setClientID("cnx_dursub2");
sess2 = cnx2.createSession(false, Session.AUTO_ACKNOWLEDGE);
cons2 = sess2.createDurableSubscriber(topic, "dursub2");
cnx2.start();
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2004 - 2009 ScalAgent Distributed Technologies
* Copyright (C) 2004 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -56,6 +56,7 @@ public class Test6 extends TestCase {
try {
ConnectionFactory cf = TcpConnectionFactory.create("localhost",2560 );
((TcpConnectionFactory) cf).getParameters().connectingTimer = 10;
((TcpConnectionFactory) cf).getParameters().clientID = "cnx_dursub";
AdminModule.connect(cf, "root", "root");
User.create("anonymous", "anonymous");
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2004 - 2009 ScalAgent Distributed Technologies
* Copyright (C) 2004 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -58,7 +58,7 @@ public class Test6b extends TestCase {
Topic topic = Topic.create("topic");
Connection cnx = cf.createConnection("anonymous", "anonymous");
cnx.setClientID("cnx_dursub");
Session sess = cnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
TopicSubscriber cons = sess.createDurableSubscriber(topic, "dursub");
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2006 - 2009 ScalAgent Distributed Technologies
* Copyright (C) 2006 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -97,6 +97,7 @@ public class CommitTest extends TestCase {
remoteTopic.setFreeWriting();
ConnectionFactory cf = TcpConnectionFactory.create("localhost", 2560);
((TcpConnectionFactory) cf).getParameters().clientID = "CommitTest";
Connection c = cf.createConnection();
Session s = c.createSession(true, 0);
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2003 - 2009 ScalAgent Distributed Technologies
* Copyright (C) 2003 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -73,6 +73,7 @@ public class Test16 extends BaseTest implements ExceptionListener {
if (debug) System.out.println("connect");
cnx1 = cf.createConnection();
cnx1.setClientID("Test16");
cnx1.setExceptionListener(this);
sess1 = cnx1.createSession(false, Session.AUTO_ACKNOWLEDGE);
if (dest instanceof org.objectweb.joram.client.jms.Queue)
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2003 - 2009 ScalAgent Distributed Technologies
* Copyright (C) 2003 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -86,6 +86,7 @@ public class Test17 extends BaseTest implements ExceptionListener, MessageListen
try {
// System.out.println("connect");
cnx1 = cf.createConnection();
cnx1.setClientID("Test17");
cnx1.setExceptionListener(this);
sess1 = cnx1.createSession(false, Session.AUTO_ACKNOWLEDGE);
if (dest instanceof org.objectweb.joram.client.jms.Queue)
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2003 - 2007 ScalAgent Distributed Technologies
* Copyright (C) 2003 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -61,6 +61,7 @@ public class Test45 extends BaseTest {
ConnectionFactory cf = LocalConnectionFactory.create();
Connection cnx = cf.createConnection();
cnx.setClientID("Test45");
cnx.start();
Session sess1 = cnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2003 - 2007 ScalAgent Distributed Technologies
* Copyright (C) 2003 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -58,6 +58,7 @@ public class Test50 extends framework.TestCase {
ConnectionFactory cf = TcpConnectionFactory.create("localhost", 16010);
Connection cnx = cf.createConnection();
cnx.setClientID("Test50");
Session sess = cnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageConsumer cons = sess.createDurableSubscriber(topic, "subname");
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2003 - 2007 ScalAgent Distributed Technologies
* Copyright (C) 2003 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -61,7 +61,8 @@ public class Test51 extends framework.TestCase {
ConnectionFactory cf = TcpConnectionFactory.create("localhost", 16010);
Connection cnx = cf.createConnection();
cnx.setClientID("Test51");
Session sess = cnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageConsumer cons = sess.createDurableSubscriber(topic, "subname");
MessageProducer prod = sess.createProducer(topic);
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2009 ScalAgent Distributed Technologies
* Copyright (C) 2009 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -62,6 +62,7 @@ public class Test58 extends BaseTest {
AdminModule.disconnect();
Connection cnx = cf.createConnection();
cnx.setClientID("Test58");
Session sess = cnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
Topic topic1 = new Topic();
......
......@@ -96,6 +96,7 @@ public class Receiver extends BaseTest implements MessageListener {
ConnectionFactory cf = createConnectionFactory(baseclass);
((org.objectweb.joram.client.jms.ConnectionFactory)cf).getParameters().noAckedQueue = Boolean.getBoolean("noAckedQueue");
Connection cnx = cf.createConnection();
cnx.setClientID("Receiver");
Destination dest = null;
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2003 - 2009 ScalAgent Distributed Technologies
* Copyright (C) 2003 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -107,6 +107,7 @@ public class Test26 extends BaseTest {
ConnectionFactory cf = createConnectionFactory(baseclass);
Connection cnx1 = cf.createConnection();
cnx1.setClientID("Test26");
Connection cnx2 = cf.createConnection();
Receiver26 receiver[] = new Receiver26[NbReceiver];
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2003 - 2007 ScalAgent Distributed Technologies
* Copyright (C) 2003 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -100,6 +100,7 @@ public class Test28 extends framework.TestCase{
AdminModule.disconnect();
cnx = cf.createConnection();
cnx.setClientID("Test28");
Session session1 = cnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageConsumer cons1 = session1.createConsumer(topic);
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2003 - 2009 ScalAgent Distributed Technologies
* Copyright (C) 2003 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -126,6 +126,7 @@ public class Test34 extends BaseTest {
writeIntoFile("| sender " + ((NbMsg *1000L)/(dt1)) + " msg/s");
Connection cnx2 = cf.createConnection();
cnx2.setClientID("Test34");
Session sess2 = cnx2.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageConsumer cons = null;
if (SubDurable && (dest instanceof Topic))
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2003 - 2009 ScalAgent Distributed Technologies
* Copyright (C) 2003 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -99,6 +99,7 @@ public class Test47 extends BaseTest {
writeIntoFile("----------------------------------------------------");
Connection cnx0 = cf0.createConnection();
cnx0.setClientID("Test47");
Connection cnx1 = cf1.createConnection();
Receiver47 receiver = new Receiver47(cnx0, dest, NbMsgPerRound);
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2006 - 2009 ScalAgent Distributed Technologies
* Copyright (C) 2006 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -55,6 +55,7 @@ public class Recover_3 extends TestCase {
try {
cnx = cf.createConnection();
cnxCons = cf.createConnection();
cnxCons.setClientID("Recover3");
sessionp = cnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
sessionc = cnxCons.createSession(false, Session.AUTO_ACKNOWLEDGE);
cnx.start();
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2006 - 2009 ScalAgent Distributed Technologies
* Copyright (C) 2006 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -55,6 +55,7 @@ public class Recover_4 extends TestCase {
try {
cnx = cf.createConnection();
cnxCons = cf.createConnection();
cnxCons.setClientID("Rcover_4");
sessionp = cnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
sessionc = cnxCons.createSession(false, Session.CLIENT_ACKNOWLEDGE);
cnx.start();
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2003 - 2009 ScalAgent Distributed Technologies
* Copyright (C) 2003 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -72,6 +72,7 @@ public class Test6 extends framework.TestCase {
ConnectionFactory cf1 = TcpConnectionFactory.create("localhost", 16011);
Connection cnx = cf1.createConnection();
cnx.setClientID("Test6");
Session session = cnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageConsumer consumer = session.createDurableSubscriber(topic, "subname");
session.close();
......@@ -120,6 +121,7 @@ public class Test6 extends framework.TestCase {
System.out.println("Servers #0, #1 started");
cnx = cf1.createConnection();
cnx.setClientID("Test6");
session = cnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
consumer = session.createDurableSubscriber(topic, "subname");
cnx.start();
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2003 - 2007 ScalAgent Distributed Technologies
* Copyright (C) 2003 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -61,6 +61,7 @@ public class Test7 extends framework.TestCase {
ConnectionFactory cf = LocalConnectionFactory.create();
Connection cnx1 = cf.createConnection();
cnx1.setClientID("Test7");
Session sess1 = cnx1.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageConsumer cons = sess1.createDurableSubscriber(topic, "subname");
sess1.close();
......@@ -84,6 +85,7 @@ public class Test7 extends framework.TestCase {
Thread.sleep(1000L);
cnx1 = cf.createConnection();
cnx1.setClientID("Test7");
sess1 = cnx1.createSession(false, Session.AUTO_ACKNOWLEDGE);
cons = sess1.createDurableSubscriber(topic, "subname");
cnx1.start();
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Initial developer(s): ScalAgent Distributed Technologies
* Contributor(s):
*/
package joram.shell.mom;
import java.io.BufferedWriter;
......@@ -904,6 +926,7 @@ public class MOMTester extends Thread implements BundleActivator {
Topic topic = Topic.create(sid, topicName);
topic.setFreeReading(); topic.setFreeWriting();
TopicConnection cnx = cf.createTopicConnection(userName,pwd);
cnx.setClientID("MOMTester");
TopicSession session = cnx.createTopicSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);
session.createDurableSubscriber(topic,subName);
}
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2012 ScalAgent Distributed Technologies
* Copyright (C) 2012 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -83,6 +83,7 @@ public class Sub5 extends TestCase {
// connection for subscriber
cnx = (Connection) cf.createConnection("anonymous", "anonymous");
cnx.setClientID("Sub5");
sess1 = (Session) cnx.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer prod = sess1.createProducer(topic);
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2008 ScalAgent Distributed Technologies
* Copyright (C) 2008 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -77,6 +77,7 @@ public class Test1_Topic extends TestCase {
cnx.start();
Connection cnxCons = cf1.createConnection();
cnxCons.setClientID("Test1_Topic");
Session sessionc = cnxCons.createSession(false, Session.AUTO_ACKNOWLEDGE);
TopicSubscriber consumer = sessionc.createDurableSubscriber(topic, "top");
cnxCons.start();
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2003 - 2007 ScalAgent Distributed Technologies
* Copyright (C) 2003 - 2013 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -84,6 +84,7 @@ public class Test1 extends BaseTestCase {
ConnectionFactory cf = LocalConnectionFactory.create();
Connection cnx = cf.createConnection();
cnx.setClientID("Test1");
Session sess1 = cnx.createSession(true, Session.AUTO_ACKNOWLEDGE);
MessageProducer prod1 = sess1.createProducer(topic);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment