http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/docs/user-manual/en/using-jms.xml ---------------------------------------------------------------------- diff --git a/docs/user-manual/en/using-jms.xml b/docs/user-manual/en/using-jms.xml index 40be7b7..fdf0729 100644 --- a/docs/user-manual/en/using-jms.xml +++ b/docs/user-manual/en/using-jms.xml @@ -49,210 +49,262 @@ server JMS configuration so it is created automatically without us having to explicitly create it from the client.</para> </section> - <section id="using-jms.server.configuration"> - <title>JMS Server Configuration</title> - <para>The file <literal>activemq-jms.xml</literal> on the server classpath contains any JMS - Queue, Topic and ConnectionFactory instances that we wish to create and make available - to lookup via the JNDI.</para> - <para>A JMS ConnectionFactory object is used by the client to make connections to the - server. It knows the location of the server it is connecting to, as well as many other - configuration parameters. In most cases the defaults will be acceptable.</para> - <para>We'll deploy a single JMS Queue and a single JMS Connection Factory instance on the - server for this example but there are no limits to the number of Queues, Topics and - Connection Factory instances you can deploy from the file. Here's our - configuration:</para> - <programlisting> -<configuration xmlns="urn:activemq" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="urn:activemq ../schemas/activemq-jms.xsd "> - - <connection-factory name="ConnectionFactory"> - <connectors> - <connector-ref connector-name="netty"/> - </connectors> - <entries> - <entry name="ConnectionFactory"/> - </entries> - </connection-factory> - - <queue name="OrderQueue"> - <entry name="queues/OrderQueue"/> - </queue> -</configuration></programlisting> - <para>We deploy one ConnectionFactory called <literal>ConnectionFactory</literal> and bind - it in just one place in JNDI as given by the <literal>entry</literal> element. - ConnectionFactory instances can be bound in many places in JNDI if you require. </para> + <section id="using-jms.jndi.configuration"> + <title>JNDI Configuration</title> + <para>The JMS specification establishes the convention that <emphasis>administered + objects</emphasis> (i.e. JMS queue, topic and connection factory instances) are made + available via the JNDI API. Brokers are free to implement JNDI as they see fit assuming + the implementation fits the API. ActiveMQ does not have a JNDI server. Rather, it uses a + client-side JNDI implementation that relies on special properties set in the environment + to construct the appropriate JMS objects. In other words, no objects are stored in JNDI + on the ActiveMQ server. There are simply instantiated on the client based on the provided + configuration. Let's look at the different kinds of administered objects and how to configure + them.</para> <note> - <para>The JMS connection factory references a <literal>connector</literal> called - <literal>netty</literal>. This is a reference to a connector object deployed in - the main core configuration file <literal>activemq-configuration.xml</literal> which - defines the transport and parameters used to actually connect to the server.</para> + <para>The following configuration properties <emphasis>are strictly required when ActiveMQ + is running in stand-alone mode</emphasis>. When ActiveMQ is integrated to an application + server (e.g. Wildfly) the application server itself will almost certainly provide a JNDI + client with its own properties.</para> </note> - </section> - <section id="using-jms.configure.factory.types"> - <title>Connection Factory Types</title> - <para>The JMS API doc provides several connection factories for applications. ActiveMQ JMS users - can choose to configure the types for their connection factories. Each connection factory - has a <literal>signature</literal> attribute and a <literal>xa</literal> parameter, the - combination of which determines the type of the factory. Attribute <literal>signature</literal> - has three possible string values, i.e. <emphasis>generic</emphasis>, - <emphasis>queue</emphasis> and <emphasis>topic</emphasis>; <literal>xa</literal> is a boolean - type parameter. The following table gives their configuration values for different - connection factory interfaces.</para> - <table frame="topbot" id="using-jms.table.configure.factory.types"> + <section> + <title>ConnectionFactory JNDI</title> + <para>A JMS connection factory is used by the client to make connections to the server. + It knows the location of the server it is connecting to, as well as many other + configuration parameters.</para> + <para>By default, a <literal>javax.naming.Context</literal> instance created using the + <literal>org.apache.activemq.jndi.ActiveMQInitialContextFactory</literal> will automatically + have the following connection factories available for lookup:</para> + <itemizedlist> + <listitem> + <para><literal>ConnectionFactory</literal></para> + </listitem> + <listitem> + <para><literal>XAConnectionFactory</literal></para> + </listitem> + <listitem> + <para><literal>QueueConnectionFactory</literal></para> + </listitem> + <listitem> + <para><literal>TopicConnectionFactory</literal></para> + </listitem> + </itemizedlist> + <para>Here's a simple example of the JNDI context environment for a client looking up a connection factory + to access an <emphasis>embedded</emphasis> instance of ActiveMQ:</para> + <programlisting> +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory</programlisting> + <para>It's really as simple as that. As noted previously, any JNDI context created with the + <literal>ActiveMQInitialContextFactory</literal> will have a set of default connection factories + available. Therefore, only the <literal>java.naming.factory.initial</literal> property is required + to access an embedded broker.</para> + <para>In certain situations there could be multiple server instances running within a particular JVM. In + that situation each server would typically have an InVM acceptor with a unique server-ID. A client + using JMS and JNDI can account for this by specifying a + <literal>javax.naming.Context.PROVIDER_URL</literal> (<literal>String</literal> value of + "java.naming.provider.url") in the JNDI environment like <literal>vm://2</literal> where + <literal>2</literal> is the server-ID for acceptor.</para> + <para>Here is a list of all the supported URL schemes:</para> + <itemizedlist> + <listitem><para><literal>vm</literal></para></listitem> + <listitem><para><literal>tcp</literal></para></listitem> + <listitem><para><literal>udp</literal></para></listitem> + <listitem><para><literal>jgroups</literal></para></listitem> + </itemizedlist> + <para>Most clients won't be connecting to an embedded broker. Clients will most commonly connect + across a network a remote broker. In that case the client can use the + <literal>javax.naming.Context.PROVIDER_URL</literal> (<literal>String</literal> value of + "java.naming.provider.url") in the JNDI environment to specify where to connect. Here's a simple + example of a client configuring a connection factory to connect to a remote broker running on + myhost:5445:</para> + <programlisting> +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://myhost:5445</programlisting> + <para>In the example above the client is using the <literal>tcp</literal> scheme for the provider URL. + A client may also specify multiple comma-delimited host:port combinations in the URL (e.g. + <literal>tcp://remote-host1:5445,remote-host2:5445</literal>). Whether there is one or many + host:port combinations in the URL they are treated as the <emphasis>initial connector(s)</emphasis> + for the underlying connection.</para> + <para>The <literal>udp</literal> scheme is also supported which should use an host:port combination that + matches the <literal>group-address</literal> and <literal>group-port</literal> from the corresponding + <literal>broadcast-group</literal> configured on the ActiveMQ server(s).</para> + <para>Each scheme has a specific set of properties which can be set using the traditional URL query string + format (e.g. <literal>scheme://host:port?key1=value1&key2=value2</literal>) to customize the underlying + transport mechanism. For example, if a client wanted to connect to a remote server using TCP and SSL + it would use a <literal>Context.PROVIDER_URL</literal> of + <literal>tcp://remote-host:5445?ssl-enabled=true</literal>.</para> + <para>All the properties available for the <literal>tcp</literal> scheme are described in + <link linkend="configuring-transports.netty">the documentation regarding the Netty transport</link>.</para> + <para>The <literal>udp</literal> scheme supports 4 properties:</para> + <itemizedlist> + <listitem> + <para><literal>local-address</literal> - If you are running with multiple network interfaces on the same + machine, you may want to specify that the discovery group listens only only a specific interface. To + do this you can specify the interface address with this parameter.</para> + </listitem> + <listitem> + <para><literal>local-port</literal> - If you want to specify a local port to which the datagram socket is + bound you can specify it here. Normally you would just use the default value of -1 which signifies + that an anonymous port should be used. This parameter is always specified in conjunction with + <literal>local-address</literal>.</para> + </listitem> + <listitem> + <para><literal>refresh-timeout</literal> - This is the period the discovery group waits after receiving + the last broadcast from a particular server before removing that servers connector pair entry from its + list. You would normally set this to a value significantly higher than the broadcast-period on the + broadcast group otherwise servers might intermittently disappear from the list even though they are + still broadcasting due to slight differences in timing. This parameter is optional, the default value + is 10000 milliseconds (10 seconds).</para> + </listitem> + <listitem> + <para><literal>discovery-initial-wait-timeout</literal> - If the connection factory is used immediately + after creation then it may not have had enough time to received broadcasts from all the nodes in the + cluster. On first usage, the connection factory will make sure it waits this long since creation + before creating the first connection. The default value for this parameter is 10000 milliseconds.</para> + </listitem> + </itemizedlist> + <para>Lastly, the <literal>jgroups</literal> scheme is supported which provides an alternative to the + <literal>udp</literal> scheme for server discovery. The URL pattern is as follows + <literal>jgroups://<jgroups-xml-conf-filename></literal> where + <literal><jgroups-xml-conf-filename></literal> refers to an XML file on the classpath that contains + the JGroups configuration.</para> + <para>The <literal>refresh-timeout</literal> and <literal>discovery-initial-wait-timeout</literal> properties + are supported just like with <literal>udp</literal>.</para> + <para>Although a <literal>javax.naming.Context</literal> instance created using the + <literal>org.apache.activemq.jndi.ActiveMQInitialContextFactory</literal> will automatically + have some connection factories present, it is possible for a client to specify its own connection + factories. This is done using the + <literal>org.apache.activemq.jndi.ActiveMQInitialContextFactory.CONNECTION_FACTORY_NAMES</literal> + property (String value of "connectionFactoryNames"). The value for this property is a comma delimited + String of all the connection factories the client wishes to create. For example:</para> + <programlisting> +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:5445 +connectionFactoryNames=myConnectionFactory</programlisting> + <para>In this example, the client is creating a connection factory named "myConnectionFactory." This + replaces all the default connection factories so that only the "myConnectionFactory" connection factory + is available to the client.</para> + <para>Aside from the underlying transport, the underlying connection factory implementation can also be + configured using special properties. To configure a particular connection factory the client would + follow this pattern for the property name to set in the environment: + <literal>connection.<connection-factory-name>.<property-name></literal>. For example, if the + client wanted to customize the default connection factory "ConnectionFactory" to support + high-availability then it would do this:</para> + <programlisting> +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://myhost:5445 +connection.ConnectionFactory.ha=true</programlisting> + <para>Any property available on the underlying + <literal>org.apache.activemq.jms.client.ActiveMQConnectionFactory</literal> can be set this way in + addition to the <literal>ha</literal> (boolean) and <literal>type</literal> (String) properties. Here + are the different options for the <literal>type</literal>:</para> + <table frame="topbot" id="using-jms.table.configure.factory.types"> <title>Configuration for Connection Factory Types</title> <tgroup cols="3"> - <colspec colname="signature" colnum="1"/> - <colspec colname="xa" colnum="2"/> - <colspec colname="cftype" colnum="3"/> + <colspec colname="cftype" colnum="1"/> + <colspec colname="interface" colnum="2"/> <thead> <row> - <entry>signature</entry> - <entry>xa</entry> - <entry>Connection Factory Type</entry> + <entry>type</entry> + <entry>interface</entry> </row> </thead> <tbody> <row> - <entry>generic (default)</entry> - <entry>false (default)</entry> + <entry>CF (default)</entry> <entry>javax.jms.ConnectionFactory</entry> </row> <row> - <entry>generic</entry> - <entry>true</entry> + <entry>XA_CF</entry> <entry>javax.jms.XAConnectionFactory</entry> </row> <row> - <entry>queue</entry> - <entry>false</entry> + <entry>QUEUE_CF</entry> <entry>javax.jms.QueueConnectionFactory</entry> </row> <row> - <entry>queue</entry> - <entry>true</entry> + <entry>QUEUE_XA_CF</entry> <entry>javax.jms.XAQueueConnectionFactory</entry> </row> <row> - <entry>topic</entry> - <entry>false</entry> + <entry>TOPIC_CF</entry> <entry>javax.jms.TopicConnectionFactory</entry> </row> <row> - <entry>topic</entry> - <entry>true</entry> + <entry>TOPIC_XA_CF</entry> <entry>javax.jms.XATopicConnectionFactory</entry> </row> </tbody> </tgroup> </table> - <para>As an example, the following configures an XAQueueConnectionFactory:</para> - <programlisting> -<configuration xmlns="urn:activemq" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="urn:activemq ../schemas/activemq-jms.xsd "> - - <connection-factory name="ConnectionFactory" signature="queue"> - <xa>true</xa> - <connectors> - <connector-ref connector-name="netty"/> - </connectors> - <entries> - <entry name="ConnectionFactory"/> - </entries> - </connection-factory> -</configuration></programlisting> - - </section> - <section> - <title>JNDI configuration</title> - <para>When using JNDI from the client side you need to specify a set of JNDI properties - which tell the JNDI client where to locate the JNDI server, amongst other things. These - are often specified in a file called <literal>jndi.properties</literal> on the client - classpath, or you can specify them directly when creating the JNDI initial context. A - full JNDI tutorial is outside the scope of this document, please see the <ulink - url="http://docs.oracle.com/javase/jndi/tutorial">Sun JNDI tutorial</ulink> - for more information on how to use JNDI.</para> - <para>For talking to the JBoss JNDI Server, the jndi properties will look something like - this:</para> - <programlisting> -java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory -java.naming.provider.url=jnp://myhost:1099 -java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces</programlisting> - <para>Where <literal>myhost</literal> is the hostname or IP address of the JNDI server. 1099 - is the port used by the JNDI server and may vary depending on how you have configured - your JNDI server.</para> - <para>In the default standalone configuration, JNDI server ports are configured in the file - <literal>activemq-beans.xml</literal> by setting properties on the <literal - >JNDIServer</literal> bean:</para> - <programlisting> -<bean name="StandaloneServer" class="org.apache.activemq.jms.server.impl.StandaloneNamingServer"> - <constructor> - <parameter> - <inject bean="ActiveMQServer"/> - </parameter> - </constructor> - <property name="port">${jnp.port:1099}</property> - <property name="bindAddress">${jnp.host:localhost}</property> - <property name="rmiPort">${jnp.rmiPort:1098}</property> - <property name="rmiBindAddress">${jnp.host:localhost}</property> -</bean></programlisting> - <note> - <para>If you want your JNDI server to be available to non local clients make sure you - change its bind address to something other than <literal - >localhost</literal>!</para> - </note> - <note> - <para>The JNDIServer bean must be defined <emphasis>only when ActiveMQ is running in - stand-alone mode</emphasis>. When ActiveMQ is integrated to JBoss Application - Server, JBoss AS will provide a ready-to-use JNDI server without any additional - configuration.</para> - </note> - </section> - <section> - <title>The code</title> - <para>Here's the code for the example:</para> - <para>First we'll create a JNDI initial context from which to lookup our JMS objects:</para> - <programlisting>InitialContext ic = new InitialContext();</programlisting> - <para>Now we'll look up the connection factory:</para> - <programlisting>ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");</programlisting> - <para>And look up the Queue:</para> - <programlisting>Queue orderQueue = (Queue)ic.lookup("/queues/OrderQueue");</programlisting> - <para>Next we create a JMS connection using the connection factory:</para> - <programlisting>Connection connection = cf.createConnection();</programlisting> - <para>And we create a non transacted JMS Session, with AUTO_ACKNOWLEDGE acknowledge - mode:</para> - <programlisting>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</programlisting> - <para>We create a MessageProducer that will send orders to the queue:</para> - <programlisting>MessageProducer producer = session.createProducer(orderQueue);</programlisting> - <para>And we create a MessageConsumer which will consume orders from the queue:</para> - <programlisting>MessageConsumer consumer = session.createConsumer(orderQueue);</programlisting> - <para>We make sure we start the connection, or delivery won't occur on it:</para> - <programlisting>connection.start();</programlisting> - <para>We create a simple TextMessage and send it:</para> - <programlisting>TextMessage message = session.createTextMessage("This is an order"); + </section> + <section> + <title>Destination JNDI</title> + <para>JMS destinations are also typically looked up via JNDI. As with connection factories, destinations can + be configured using special properties in the JNDI context environment. The property + <emphasis>name</emphasis> should follow the pattern: <literal>queue.<jndi-binding></literal> or + <literal>topic.<jndi-binding></literal>. The property <emphasis>value</emphasis> should be the name + of the queue hosted by the ActiveMQ server. For example, if the server had a JMS queue configured like + so:</para> + <programlisting> +<queue name="OrderQueue"/></programlisting> + <para>And if the client wanted to bind this queue to "queues/OrderQueue" then the JNDI properties would be + configured like so:</para> + <programlisting> +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://myhost:5445 +queue.queues/OrderQueue=OrderQueue</programlisting> + <para>It is also possible to look-up JMS destinations which haven't been configured explicitly in the JNDI + context environment. This is possible using <literal>dynamicQueues/</literal> or + <literal>dynamicTopics/</literal> in the look-up string. For example, if the client wanted to look-up the + aforementioned "OrderQueue" it could do so simply by using the string "dynamicQueues/OrderQueue". Note, + the text that follows <literal>dynamicQueues/</literal> or <literal>dynamicTopics/</literal> must + correspond <emphasis>exactly</emphasis> to the name of the destination on the server.</para> + </section> + <section> + <title>The code</title> + <para>Here's the code for the example:</para> + <para>First we'll create a JNDI initial context from which to lookup our JMS objects. If the above + properties are set in <literal>jndi.properties</literal> and it is on the classpath then any new, empty + <literal>InitialContext</literal> will be initialized using those properties:</para> + <programlisting>InitialContext ic = new InitialContext();</programlisting> + <para>Now we'll look up the connection factory from which we can create connections to myhost:5445:</para> + <programlisting>ConnectionFactory cf = (ConnectionFactory)ic.lookup("ConnectionFactory");</programlisting> + <para>And look up the Queue:</para> + <programlisting>Queue orderQueue = (Queue)ic.lookup("queues/OrderQueue");</programlisting> + <para>Next we create a JMS connection using the connection factory:</para> + <programlisting>Connection connection = cf.createConnection();</programlisting> + <para>And we create a non transacted JMS Session, with AUTO_ACKNOWLEDGE acknowledge + mode:</para> + <programlisting>Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);</programlisting> + <para>We create a MessageProducer that will send orders to the queue:</para> + <programlisting>MessageProducer producer = session.createProducer(orderQueue);</programlisting> + <para>And we create a MessageConsumer which will consume orders from the queue:</para> + <programlisting>MessageConsumer consumer = session.createConsumer(orderQueue);</programlisting> + <para>We make sure we start the connection, or delivery won't occur on it:</para> + <programlisting>connection.start();</programlisting> + <para>We create a simple TextMessage and send it:</para> + <programlisting>TextMessage message = session.createTextMessage("This is an order"); producer.send(message);</programlisting> - <para>And we consume the message:</para> - <programlisting>TextMessage receivedMessage = (TextMessage)consumer.receive(); + <para>And we consume the message:</para> + <programlisting>TextMessage receivedMessage = (TextMessage)consumer.receive(); System.out.println("Got order: " + receivedMessage.getText());</programlisting> - <para>It is as simple as that. For a wide range of working JMS examples please see the - examples directory in the distribution.</para> - <warning> - <para>Please note that JMS connections, sessions, producers and consumers are - <emphasis>designed to be re-used</emphasis>.</para> - <para>It is an anti-pattern to create new connections, sessions, producers and consumers - for each message you produce or consume. If you do this, your application will - perform very poorly. This is discussed further in the section on performance tuning - <xref linkend="perf-tuning"/>.</para> - </warning> + <para>It is as simple as that. For a wide range of working JMS examples please see the + examples directory in the distribution.</para> + <warning> + <para>Please note that JMS connections, sessions, producers and consumers are + <emphasis>designed to be re-used</emphasis>.</para> + <para>It is an anti-pattern to create new connections, sessions, producers and consumers + for each message you produce or consume. If you do this, your application will + perform very poorly. This is discussed further in the section on performance tuning + <xref linkend="perf-tuning"/>.</para> + </warning> + </section> </section> <section> <title>Directly instantiating JMS Resources without using JNDI</title> <para>Although it is a very common JMS usage pattern to lookup JMS <emphasis>Administered - Objects</emphasis> (that's JMS Queue, Topic and ConnectionFactory instances) from - JNDI, in some cases a JNDI server is not available and you still want to use JMS, or you - just think "Why do I need JNDI? Why can't I just instantiate these objects - directly?"</para> + Objects</emphasis> (that's JMS Queue, Topic and ConnectionFactory instances) from JNDI, + in some cases you just think "Why do I need JNDI? Why can't I just instantiate these + objects directly?"</para> <para>With ActiveMQ you can do exactly that. ActiveMQ supports the direct instantiation of JMS Queue, Topic and ConnectionFactory instances, so you don't have to use JNDI at all.</para>
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/core/embedded-remote/pom.xml ---------------------------------------------------------------------- diff --git a/examples/core/embedded-remote/pom.xml b/examples/core/embedded-remote/pom.xml index d84c035..9c63c97 100644 --- a/examples/core/embedded-remote/pom.xml +++ b/examples/core/embedded-remote/pom.xml @@ -38,11 +38,6 @@ <version>1.1.0.GA</version> </dependency> <dependency> - <groupId>org.jboss.naming</groupId> - <artifactId>jnp-client</artifactId> - <version>5.0.5.Final</version> - </dependency> - <dependency> <groupId>org.jboss.spec.javax.jms</groupId> <artifactId>jboss-jms-api_2.0_spec</artifactId> </dependency> http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/core/embedded/pom.xml ---------------------------------------------------------------------- diff --git a/examples/core/embedded/pom.xml b/examples/core/embedded/pom.xml index c49ff57..ac01956 100644 --- a/examples/core/embedded/pom.xml +++ b/examples/core/embedded/pom.xml @@ -38,11 +38,6 @@ <version>1.1.0.GA</version> </dependency> <dependency> - <groupId>org.jboss.naming</groupId> - <artifactId>jnp-client</artifactId> - <version>5.0.5.Final</version> - </dependency> - <dependency> <groupId>org.jboss.spec.javax.jms</groupId> <artifactId>jboss-jms-api_2.0_spec</artifactId> </dependency> http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/core/perf/pom.xml ---------------------------------------------------------------------- diff --git a/examples/core/perf/pom.xml b/examples/core/perf/pom.xml index 5f56bbc..6db15e9 100644 --- a/examples/core/perf/pom.xml +++ b/examples/core/perf/pom.xml @@ -34,11 +34,6 @@ <version>1.1.0.GA</version> </dependency> <dependency> - <groupId>org.jboss.naming</groupId> - <artifactId>jnp-client</artifactId> - <version>5.0.5.Final</version> - </dependency> - <dependency> <groupId>org.apache.activemq.examples.jms</groupId> <artifactId>activemq-jms-examples-common</artifactId> <version>${project.version}</version> @@ -118,11 +113,6 @@ <artifactId>jboss-jms-api</artifactId> <version>1.1.0.GA</version> </dependency> - <dependency> - <groupId>org.jboss.naming</groupId> - <artifactId>jnpserver</artifactId> - <version>5.0.3.GA</version> - </dependency> </dependencies> </plugin> </plugins> http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/core/vertx-connector/pom.xml ---------------------------------------------------------------------- diff --git a/examples/core/vertx-connector/pom.xml b/examples/core/vertx-connector/pom.xml index 79e83f9..c12f66a 100644 --- a/examples/core/vertx-connector/pom.xml +++ b/examples/core/vertx-connector/pom.xml @@ -42,11 +42,6 @@ <version>1.1.0.GA</version> </dependency> <dependency> - <groupId>org.jboss.naming</groupId> - <artifactId>jnp-client</artifactId> - <version>5.0.5.Final</version> - </dependency> - <dependency> <groupId>org.jboss.spec.javax.jms</groupId> <artifactId>jboss-jms-api_2.0_spec</artifactId> </dependency> @@ -149,11 +144,6 @@ <version>1.1.0.GA</version> </dependency> <dependency> - <groupId>org.jboss.naming</groupId> - <artifactId>jnpserver</artifactId> - <version>5.0.3.GA</version> - </dependency> - <dependency> <groupId>io.vertx</groupId> <artifactId>vertx-core</artifactId> <version>${vertx.version}</version> http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/core/vertx-connector/src/main/resources/server0/activemq-jms.xml ---------------------------------------------------------------------- diff --git a/examples/core/vertx-connector/src/main/resources/server0/activemq-jms.xml b/examples/core/vertx-connector/src/main/resources/server0/activemq-jms.xml index 452b958..847659f 100644 --- a/examples/core/vertx-connector/src/main/resources/server0/activemq-jms.xml +++ b/examples/core/vertx-connector/src/main/resources/server0/activemq-jms.xml @@ -1,19 +1,8 @@ <configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd"> - <!--the connection factory used by the example--> - <connection-factory name="ConnectionFactory"> - <connectors> - <connector-ref connector-name="netty-connector"/> - </connectors> - <entries> - <entry name="ConnectionFactory"/> - </entries> - </connection-factory> <!--the queue used by the example--> - <queue name="exampleQueue"> - <entry name="/queue/exampleQueue"/> - </queue> + <queue name="exampleQueue"/> </configuration> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/activemq-jms-examples-common/config/server.properties ---------------------------------------------------------------------- diff --git a/examples/jms/activemq-jms-examples-common/config/server.properties b/examples/jms/activemq-jms-examples-common/config/server.properties index 0388e87..138f055 100644 --- a/examples/jms/activemq-jms-examples-common/config/server.properties +++ b/examples/jms/activemq-jms-examples-common/config/server.properties @@ -1 +1 @@ -server.args=-XX:+UseParallelGC -Xms256M -Xmx256M -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Dcom.sun.management.jmxremote -Djava.util.logging.config.file=${imported.basedir}/config/logging.properties -Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory -Djava.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces \ No newline at end of file +server.args=-XX:+UseParallelGC -Xms256M -Xmx256M -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Dcom.sun.management.jmxremote -Djava.util.logging.config.file=${imported.basedir}/config/logging.properties -Djava.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory \ No newline at end of file http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/activemq-jms-examples-common/src/main/java/org/apache/activemq/common/example/ActiveMQExample.java ---------------------------------------------------------------------- diff --git a/examples/jms/activemq-jms-examples-common/src/main/java/org/apache/activemq/common/example/ActiveMQExample.java b/examples/jms/activemq-jms-examples-common/src/main/java/org/apache/activemq/common/example/ActiveMQExample.java index 7c19bc3..86059b6 100644 --- a/examples/jms/activemq-jms-examples-common/src/main/java/org/apache/activemq/common/example/ActiveMQExample.java +++ b/examples/jms/activemq-jms-examples-common/src/main/java/org/apache/activemq/common/example/ActiveMQExample.java @@ -180,9 +180,10 @@ public abstract class ActiveMQExample { ActiveMQExample.log.info("using " + args[serverId] + " for jndi"); Properties props = new Properties(); - props.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory"); + props.put("java.naming.factory.initial", "org.apache.activemq.jndi.ActiveMQInitialContextFactory"); props.put("java.naming.provider.url", args[serverId]); - props.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces"); + props.put("queue.queue/exampleQueue", "exampleQueue"); + props.put("topic.topic/exampleTopic", "exampleTopic"); return new InitialContext(props); } http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/aerogear/pom.xml ---------------------------------------------------------------------- diff --git a/examples/jms/aerogear/pom.xml b/examples/jms/aerogear/pom.xml index 4ae12ea..516d13f 100644 --- a/examples/jms/aerogear/pom.xml +++ b/examples/jms/aerogear/pom.xml @@ -70,7 +70,7 @@ <configuration> <clientClass>org.apache.activemq.jms.example.AerogearExample</clientClass> <args> - <param>jnp://localhost:1099</param> + <param>tcp://localhost:5445</param> </args> </configuration> </execution> @@ -122,11 +122,6 @@ <artifactId>jboss-jms-api</artifactId> <version>1.1.0.GA</version> </dependency> - <dependency> - <groupId>org.jboss.naming</groupId> - <artifactId>jnpserver</artifactId> - <version>5.0.3.GA</version> - </dependency> </dependencies> <configuration> <waitOnStart>false</waitOnStart> http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/aerogear/src/main/java/org/apache/activemq/jms/example/AerogearExample.java ---------------------------------------------------------------------- diff --git a/examples/jms/aerogear/src/main/java/org/apache/activemq/jms/example/AerogearExample.java b/examples/jms/aerogear/src/main/java/org/apache/activemq/jms/example/AerogearExample.java index b9f10b1..1c4ec67 100644 --- a/examples/jms/aerogear/src/main/java/org/apache/activemq/jms/example/AerogearExample.java +++ b/examples/jms/aerogear/src/main/java/org/apache/activemq/jms/example/AerogearExample.java @@ -51,10 +51,10 @@ public class AerogearExample extends ActiveMQExample initialContext = getContext(0); // Step 2. Perfom a lookup on the queue - Queue queue = (Queue)initialContext.lookup("/queue/aerogearQueue"); + Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); // Step 3. Perform a lookup on the Connection Factory - ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("/ConnectionFactory"); + ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("ConnectionFactory"); // Step 4.Create a JMS Connection connection = cf.createConnection(); http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/aerogear/src/main/resources/hornetq/server0/activemq-jms.xml ---------------------------------------------------------------------- diff --git a/examples/jms/aerogear/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/aerogear/src/main/resources/hornetq/server0/activemq-jms.xml index edc985f..2483255 100644 --- a/examples/jms/aerogear/src/main/resources/hornetq/server0/activemq-jms.xml +++ b/examples/jms/aerogear/src/main/resources/hornetq/server0/activemq-jms.xml @@ -1,19 +1,8 @@ <configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd"> - <!--the connection factory used by the example--> - <connection-factory name="ConnectionFactory"> - <connectors> - <connector-ref connector-name="netty-connector"/> - </connectors> - <entries> - <entry name="ConnectionFactory"/> - </entries> - </connection-factory> <!--the queue used by the example--> - <queue name="aerogearQueue"> - <entry name="/queue/aerogearQueue"/> - </queue> + <queue name="aerogearQueue"/> </configuration> http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/applet/pom.xml ---------------------------------------------------------------------- diff --git a/examples/jms/applet/pom.xml b/examples/jms/applet/pom.xml index c99b2c7..4a2a261 100644 --- a/examples/jms/applet/pom.xml +++ b/examples/jms/applet/pom.xml @@ -51,7 +51,7 @@ <configuration> <clientClass>org.apache.activemq.jms.example.AppletExample</clientClass> <args> - <param>jnp://localhost:1099</param> + <param>tcp://localhost:5445</param> </args> <systemProperties> <property> @@ -107,11 +107,6 @@ <artifactId>jboss-jms-api</artifactId> <version>1.1.0.GA</version> </dependency> - <dependency> - <groupId>org.jboss.naming</groupId> - <artifactId>jnpserver</artifactId> - <version>5.0.3.GA</version> - </dependency> </dependencies> <configuration> <waitOnStart>false</waitOnStart> http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/applet/src/main/resources/hornetq/server0/activemq-jms.xml ---------------------------------------------------------------------- diff --git a/examples/jms/applet/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/applet/src/main/resources/hornetq/server0/activemq-jms.xml index 1dd09a6..ab4841d 100644 --- a/examples/jms/applet/src/main/resources/hornetq/server0/activemq-jms.xml +++ b/examples/jms/applet/src/main/resources/hornetq/server0/activemq-jms.xml @@ -1,19 +1,8 @@ <configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd"> - <!--the connection factory used by the example--> - <connection-factory name="ConnectionFactory"> - <connectors> - <connector-ref connector-name="netty-connector"/> - </connectors> - <entries> - <entry name="ConnectionFactory"/> - </entries> - </connection-factory> <!--the topic used by the example--> - <topic name="exampleTopic"> - <entry name="/topic/exampleTopic"/> - </topic> + <topic name="exampleTopic"/> </configuration> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/application-layer-failover/pom.xml ---------------------------------------------------------------------- diff --git a/examples/jms/application-layer-failover/pom.xml b/examples/jms/application-layer-failover/pom.xml index 0cfa2f7..c9cfb1a 100644 --- a/examples/jms/application-layer-failover/pom.xml +++ b/examples/jms/application-layer-failover/pom.xml @@ -60,8 +60,8 @@ <configuration> <clientClass>org.apache.activemq.jms.example.ApplicationLayerFailoverExample</clientClass> <args> - <param>jnp://localhost:1099</param> - <param>jnp://localhost:1199</param> + <param>tcp://localhost:5445</param> + <param>tcp://localhost:5446</param> </args> <systemProperties> <property> @@ -126,11 +126,6 @@ <artifactId>jboss-jms-api</artifactId> <version>1.1.0.GA</version> </dependency> - <dependency> - <groupId>org.jboss.naming</groupId> - <artifactId>jnpserver</artifactId> - <version>5.0.3.GA</version> - </dependency> </dependencies> <configuration> <waitOnStart>false</waitOnStart> http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/application-layer-failover/src/main/java/org/apache/activemq/jms/example/ApplicationLayerFailoverExample.java ---------------------------------------------------------------------- diff --git a/examples/jms/application-layer-failover/src/main/java/org/apache/activemq/jms/example/ApplicationLayerFailoverExample.java b/examples/jms/application-layer-failover/src/main/java/org/apache/activemq/jms/example/ApplicationLayerFailoverExample.java index 0b7c3a8..2887e4c 100644 --- a/examples/jms/application-layer-failover/src/main/java/org/apache/activemq/jms/example/ApplicationLayerFailoverExample.java +++ b/examples/jms/application-layer-failover/src/main/java/org/apache/activemq/jms/example/ApplicationLayerFailoverExample.java @@ -152,10 +152,10 @@ public class ApplicationLayerFailoverExample extends ActiveMQExample initialContext = getContext(server); // Step 2. Look-up the JMS Queue object from JNDI - Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue"); + Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); // Step 3. Look-up a JMS Connection Factory object from JNDI on server 1 - ConnectionFactory connectionFactory = (ConnectionFactory)initialContext.lookup("/ConnectionFactory"); + ConnectionFactory connectionFactory = (ConnectionFactory)initialContext.lookup("ConnectionFactory"); // Step 4. We create a JMS Connection connection connection = connectionFactory.createConnection(); http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/application-layer-failover/src/main/resources/hornetq/server0/activemq-jms.xml ---------------------------------------------------------------------- diff --git a/examples/jms/application-layer-failover/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/application-layer-failover/src/main/resources/hornetq/server0/activemq-jms.xml index 3058fc8..0d5c953 100644 --- a/examples/jms/application-layer-failover/src/main/resources/hornetq/server0/activemq-jms.xml +++ b/examples/jms/application-layer-failover/src/main/resources/hornetq/server0/activemq-jms.xml @@ -1,19 +1,8 @@ <configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd"> - <!--the connection factory used by the example--> - <connection-factory name="ConnectionFactory"> - <connectors> - <connector-ref connector-name="netty-connector"/> - </connectors> - <entries> - <entry name="ConnectionFactory"/> - </entries> - </connection-factory> <!--the queue used by the example--> - <queue name="exampleQueue"> - <entry name="/queue/exampleQueue"/> - </queue> + <queue name="exampleQueue"/> </configuration> http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/application-layer-failover/src/main/resources/hornetq/server1/activemq-jms.xml ---------------------------------------------------------------------- diff --git a/examples/jms/application-layer-failover/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/application-layer-failover/src/main/resources/hornetq/server1/activemq-jms.xml index 3058fc8..0d5c953 100644 --- a/examples/jms/application-layer-failover/src/main/resources/hornetq/server1/activemq-jms.xml +++ b/examples/jms/application-layer-failover/src/main/resources/hornetq/server1/activemq-jms.xml @@ -1,19 +1,8 @@ <configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd"> - <!--the connection factory used by the example--> - <connection-factory name="ConnectionFactory"> - <connectors> - <connector-ref connector-name="netty-connector"/> - </connectors> - <entries> - <entry name="ConnectionFactory"/> - </entries> - </connection-factory> <!--the queue used by the example--> - <queue name="exampleQueue"> - <entry name="/queue/exampleQueue"/> - </queue> + <queue name="exampleQueue"/> </configuration> http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/bridge/pom.xml ---------------------------------------------------------------------- diff --git a/examples/jms/bridge/pom.xml b/examples/jms/bridge/pom.xml index f57adef..0c7b49c 100644 --- a/examples/jms/bridge/pom.xml +++ b/examples/jms/bridge/pom.xml @@ -64,8 +64,8 @@ <configuration> <clientClass>org.apache.activemq.jms.example.BridgeExample</clientClass> <args> - <param>jnp://localhost:1099</param> - <param>jnp://localhost:1199</param> + <param>tcp://localhost:5445</param> + <param>tcp://localhost:5446</param> </args> <systemProperties> <property> @@ -130,11 +130,6 @@ <artifactId>jboss-jms-api</artifactId> <version>1.1.0.GA</version> </dependency> - <dependency> - <groupId>org.jboss.naming</groupId> - <artifactId>jnpserver</artifactId> - <version>5.0.3.GA</version> - </dependency> </dependencies> <configuration> <waitOnStart>false</waitOnStart> http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/bridge/src/main/java/org/apache/activemq/jms/example/BridgeExample.java ---------------------------------------------------------------------- diff --git a/examples/jms/bridge/src/main/java/org/apache/activemq/jms/example/BridgeExample.java b/examples/jms/bridge/src/main/java/org/apache/activemq/jms/example/BridgeExample.java index 4cbe94c..fcf8719 100644 --- a/examples/jms/bridge/src/main/java/org/apache/activemq/jms/example/BridgeExample.java +++ b/examples/jms/bridge/src/main/java/org/apache/activemq/jms/example/BridgeExample.java @@ -59,11 +59,11 @@ public class BridgeExample extends ActiveMQExample // Step 2 - we look up the sausage-factory queue from node 0 - Queue sausageFactory = (Queue)ic0.lookup("/queue/sausage-factory"); + Queue sausageFactory = (Queue)ic0.lookup("queue/exampleQueue"); // Step 3 - we look up a JMS ConnectionFactory object from node 0 - ConnectionFactory cf0 = (ConnectionFactory)ic0.lookup("/ConnectionFactory"); + ConnectionFactory cf0 = (ConnectionFactory)ic0.lookup("ConnectionFactory"); // Step 4 - we create an initial context for looking up JNDI on node 1 @@ -71,11 +71,11 @@ public class BridgeExample extends ActiveMQExample // Step 5 - we look up the mincing-machine queue on node 1 - Queue mincingMachine = (Queue)ic1.lookup("/queue/mincing-machine"); + Queue mincingMachine = (Queue)ic1.lookup("queue/exampleQueue1"); // Step 6 - we look up a JMS ConnectionFactory object from node 1 - ConnectionFactory cf1 = (ConnectionFactory)ic1.lookup("/ConnectionFactory"); + ConnectionFactory cf1 = (ConnectionFactory)ic1.lookup("ConnectionFactory"); // Step 7. We create a JMS Connection connection0 which is a connection to server 0 http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/bridge/src/main/resources/hornetq/server0/activemq-jms.xml ---------------------------------------------------------------------- diff --git a/examples/jms/bridge/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/bridge/src/main/resources/hornetq/server0/activemq-jms.xml index 2ec4406..3f96251 100644 --- a/examples/jms/bridge/src/main/resources/hornetq/server0/activemq-jms.xml +++ b/examples/jms/bridge/src/main/resources/hornetq/server0/activemq-jms.xml @@ -1,19 +1,8 @@ <configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd"> - <!--the connection factory used by the example--> - <connection-factory name="ConnectionFactory"> - <connectors> - <connector-ref connector-name="netty-connector"/> - </connectors> - <entries> - <entry name="ConnectionFactory"/> - </entries> - </connection-factory> <!--the queue used by the example--> - <queue name="sausage-factory"> - <entry name="/queue/sausage-factory"/> - </queue> + <queue name="sausage-factory"/> </configuration> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/bridge/src/main/resources/hornetq/server1/activemq-jms.xml ---------------------------------------------------------------------- diff --git a/examples/jms/bridge/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/bridge/src/main/resources/hornetq/server1/activemq-jms.xml index 0165bf1..e4fe85a 100644 --- a/examples/jms/bridge/src/main/resources/hornetq/server1/activemq-jms.xml +++ b/examples/jms/bridge/src/main/resources/hornetq/server1/activemq-jms.xml @@ -1,19 +1,8 @@ <configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd"> - <!--the connection factory used by the example--> - <connection-factory name="ConnectionFactory"> - <connectors> - <connector-ref connector-name="netty-connector"/> - </connectors> - <entries> - <entry name="ConnectionFactory"/> - </entries> - </connection-factory> <!--the queue used by the example--> - <queue name="mincing-machine"> - <entry name="/queue/mincing-machine"/> - </queue> + <queue name="mincing-machine"/> </configuration> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/browser/pom.xml ---------------------------------------------------------------------- diff --git a/examples/jms/browser/pom.xml b/examples/jms/browser/pom.xml index 19d4284..ffcd947 100644 --- a/examples/jms/browser/pom.xml +++ b/examples/jms/browser/pom.xml @@ -44,7 +44,7 @@ <configuration> <clientClass>org.apache.activemq.jms.example.QueueBrowserExample</clientClass> <args> - <param>jnp://localhost:1099</param> + <param>tcp://localhost:5445</param> </args> </configuration> </execution> @@ -91,11 +91,6 @@ <artifactId>jboss-jms-api</artifactId> <version>1.1.0.GA</version> </dependency> - <dependency> - <groupId>org.jboss.naming</groupId> - <artifactId>jnpserver</artifactId> - <version>5.0.3.GA</version> - </dependency> </dependencies> <configuration> <waitOnStart>false</waitOnStart> http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/browser/src/main/java/org/apache/activemq/jms/example/QueueBrowserExample.java ---------------------------------------------------------------------- diff --git a/examples/jms/browser/src/main/java/org/apache/activemq/jms/example/QueueBrowserExample.java b/examples/jms/browser/src/main/java/org/apache/activemq/jms/example/QueueBrowserExample.java index bf2093b..52e7fe1 100644 --- a/examples/jms/browser/src/main/java/org/apache/activemq/jms/example/QueueBrowserExample.java +++ b/examples/jms/browser/src/main/java/org/apache/activemq/jms/example/QueueBrowserExample.java @@ -55,10 +55,10 @@ public class QueueBrowserExample extends ActiveMQExample initialContext = getContext(0); // Step 2. Perfom a lookup on the queue - Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue"); + Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); // Step 3. Perform a lookup on the Connection Factory - ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("/ConnectionFactory"); + ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("ConnectionFactory"); // Step 4. Create a JMS Connection connection = cf.createConnection(); http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/browser/src/main/resources/hornetq/server0/activemq-jms.xml ---------------------------------------------------------------------- diff --git a/examples/jms/browser/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/browser/src/main/resources/hornetq/server0/activemq-jms.xml index 452b958..847659f 100644 --- a/examples/jms/browser/src/main/resources/hornetq/server0/activemq-jms.xml +++ b/examples/jms/browser/src/main/resources/hornetq/server0/activemq-jms.xml @@ -1,19 +1,8 @@ <configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd"> - <!--the connection factory used by the example--> - <connection-factory name="ConnectionFactory"> - <connectors> - <connector-ref connector-name="netty-connector"/> - </connectors> - <entries> - <entry name="ConnectionFactory"/> - </entries> - </connection-factory> <!--the queue used by the example--> - <queue name="exampleQueue"> - <entry name="/queue/exampleQueue"/> - </queue> + <queue name="exampleQueue"/> </configuration> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/client-kickoff/pom.xml ---------------------------------------------------------------------- diff --git a/examples/jms/client-kickoff/pom.xml b/examples/jms/client-kickoff/pom.xml index c254db9..3e0a2ed 100644 --- a/examples/jms/client-kickoff/pom.xml +++ b/examples/jms/client-kickoff/pom.xml @@ -75,7 +75,7 @@ <configuration> <clientClass>org.apache.activemq.jms.example.ClientKickoffExample</clientClass> <args> - <param>jnp://localhost:1099</param> + <param>tcp://localhost:5445</param> </args> </configuration> </execution> @@ -122,11 +122,6 @@ <artifactId>jboss-jms-api</artifactId> <version>1.1.0.GA</version> </dependency> - <dependency> - <groupId>org.jboss.naming</groupId> - <artifactId>jnpserver</artifactId> - <version>5.0.3.GA</version> - </dependency> </dependencies> <configuration> <waitOnStart>false</waitOnStart> http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/client-kickoff/src/main/java/org/apache/activemq/jms/example/ClientKickoffExample.java ---------------------------------------------------------------------- diff --git a/examples/jms/client-kickoff/src/main/java/org/apache/activemq/jms/example/ClientKickoffExample.java b/examples/jms/client-kickoff/src/main/java/org/apache/activemq/jms/example/ClientKickoffExample.java index afd6083..80957f7 100644 --- a/examples/jms/client-kickoff/src/main/java/org/apache/activemq/jms/example/ClientKickoffExample.java +++ b/examples/jms/client-kickoff/src/main/java/org/apache/activemq/jms/example/ClientKickoffExample.java @@ -60,7 +60,7 @@ public class ClientKickoffExample extends ActiveMQExample initialContext = getContext(0); // Step 2. Perform a lookup on the Connection Factory - QueueConnectionFactory cf = (QueueConnectionFactory)initialContext.lookup("/ConnectionFactory"); + QueueConnectionFactory cf = (QueueConnectionFactory)initialContext.lookup("ConnectionFactory"); // Step 3.Create a JMS Connection connection = cf.createQueueConnection(); http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/client-kickoff/src/main/resources/hornetq/server0/activemq-jms.xml ---------------------------------------------------------------------- diff --git a/examples/jms/client-kickoff/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/client-kickoff/src/main/resources/hornetq/server0/activemq-jms.xml index 3de4046..10a6dba 100644 --- a/examples/jms/client-kickoff/src/main/resources/hornetq/server0/activemq-jms.xml +++ b/examples/jms/client-kickoff/src/main/resources/hornetq/server0/activemq-jms.xml @@ -1,14 +1,5 @@ <configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd"> - <!--the connection factory used by the example--> - <connection-factory name="ConnectionFactory" signature="queue"> - <connectors> - <connector-ref connector-name="netty"/> - </connectors> - <entries> - <entry name="ConnectionFactory"/> - </entries> - </connection-factory> </configuration> http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/client-side-failoverlistener/pom.xml ---------------------------------------------------------------------- diff --git a/examples/jms/client-side-failoverlistener/pom.xml b/examples/jms/client-side-failoverlistener/pom.xml index 37ffe90..402cced 100644 --- a/examples/jms/client-side-failoverlistener/pom.xml +++ b/examples/jms/client-side-failoverlistener/pom.xml @@ -80,8 +80,8 @@ <configuration> <clientClass>org.apache.activemq.jms.example.ClientSideFailoverListerExample</clientClass> <args> - <param>jnp://localhost:1099</param> - <param>jnp://localhost:1199</param> + <param>tcp://localhost:5445</param> + <param>tcp://localhost:5446</param> </args> <systemProperties> <property> @@ -146,11 +146,6 @@ <artifactId>jboss-jms-api</artifactId> <version>1.1.0.GA</version> </dependency> - <dependency> - <groupId>org.jboss.naming</groupId> - <artifactId>jnpserver</artifactId> - <version>5.0.3.GA</version> - </dependency> </dependencies> <configuration> <waitOnStart>false</waitOnStart> http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/client-side-failoverlistener/src/main/java/org/apache/activemq/jms/example/ClientSideFailoverListerExample.java ---------------------------------------------------------------------- diff --git a/examples/jms/client-side-failoverlistener/src/main/java/org/apache/activemq/jms/example/ClientSideFailoverListerExample.java b/examples/jms/client-side-failoverlistener/src/main/java/org/apache/activemq/jms/example/ClientSideFailoverListerExample.java index 0114786..46b7b63 100644 --- a/examples/jms/client-side-failoverlistener/src/main/java/org/apache/activemq/jms/example/ClientSideFailoverListerExample.java +++ b/examples/jms/client-side-failoverlistener/src/main/java/org/apache/activemq/jms/example/ClientSideFailoverListerExample.java @@ -58,10 +58,10 @@ public class ClientSideFailoverListerExample extends ActiveMQExample initialContext = getContext(0); // Step 2. Look-up the JMS Queue object from JNDI - Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue"); + Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); // Step 3. Look-up a JMS Connection Factory object from JNDI on server 0 - ConnectionFactory connectionFactory = (ConnectionFactory)initialContext.lookup("/ConnectionFactory"); + ConnectionFactory connectionFactory = (ConnectionFactory)initialContext.lookup("ConnectionFactory"); // Step 4. We create 1 JMS connections from the same connection factory. // Wait a little while to make sure broadcasts from all nodes have reached the client http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/client-side-failoverlistener/src/main/resources/hornetq/server0/activemq-jms.xml ---------------------------------------------------------------------- diff --git a/examples/jms/client-side-failoverlistener/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/client-side-failoverlistener/src/main/resources/hornetq/server0/activemq-jms.xml index 889b59d..0d5c953 100644 --- a/examples/jms/client-side-failoverlistener/src/main/resources/hornetq/server0/activemq-jms.xml +++ b/examples/jms/client-side-failoverlistener/src/main/resources/hornetq/server0/activemq-jms.xml @@ -1,33 +1,8 @@ <configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd"> - <!--the connection factory used by the example--> - <connection-factory name="ConnectionFactory"> - <connectors> - <connector-ref connector-name="netty-connector"/> - </connectors> - - <entries> - <entry name="ConnectionFactory"/> - </entries> - - <ha>true</ha> - <!-- Pause 1 second between connect attempts --> - <retry-interval>1000</retry-interval> - - <!-- Multiply subsequent reconnect pauses by this multiplier. This can be used to - implement an exponential back-off. For our purposes we just set to 1.0 so each reconnect - pause is the same length --> - <retry-interval-multiplier>1.0</retry-interval-multiplier> - - <!-- Try reconnecting an unlimited number of times (-1 means "unlimited") --> - <reconnect-attempts>-1</reconnect-attempts> - - </connection-factory> <!--the queue used by the example--> - <queue name="exampleQueue"> - <entry name="/queue/exampleQueue"/> - </queue> + <queue name="exampleQueue"/> </configuration> http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/client-side-failoverlistener/src/main/resources/hornetq/server1/activemq-jms.xml ---------------------------------------------------------------------- diff --git a/examples/jms/client-side-failoverlistener/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/client-side-failoverlistener/src/main/resources/hornetq/server1/activemq-jms.xml index c3b0393..0d5c953 100644 --- a/examples/jms/client-side-failoverlistener/src/main/resources/hornetq/server1/activemq-jms.xml +++ b/examples/jms/client-side-failoverlistener/src/main/resources/hornetq/server1/activemq-jms.xml @@ -1,32 +1,8 @@ <configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd"> - <!--the connection factory used by the example--> - <connection-factory name="ConnectionFactory"> - <connectors> - <connector-ref connector-name="netty-connector"/> - </connectors> - - <entries> - <entry name="ConnectionFactory"/> - </entries> - - <ha>true</ha> - <!-- Pause 1 second between connect attempts --> - <retry-interval>1000</retry-interval> - - <!-- Multiply subsequent reconnect pauses by this multiplier. This can be used to - implement an exponential back-off. For our purposes we just set to 1.0 so each reconnect - pause is the same length --> - <retry-interval-multiplier>1.0</retry-interval-multiplier> - - <!-- Try reconnecting an unlimited number of times (-1 means "unlimited") --> - <reconnect-attempts>-1</reconnect-attempts> - </connection-factory> <!--the queue used by the example--> - <queue name="exampleQueue"> - <entry name="/queue/exampleQueue"/> - </queue> + <queue name="exampleQueue"/> </configuration> http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/client-side-load-balancing/pom.xml ---------------------------------------------------------------------- diff --git a/examples/jms/client-side-load-balancing/pom.xml b/examples/jms/client-side-load-balancing/pom.xml index 2e4f24a..9ce2b28 100644 --- a/examples/jms/client-side-load-balancing/pom.xml +++ b/examples/jms/client-side-load-balancing/pom.xml @@ -101,8 +101,8 @@ <configuration> <clientClass>org.apache.activemq.jms.example.ClientSideLoadBalancingExample</clientClass> <args> - <param>jnp://localhost:1099</param> - <param>jnp://localhost:1199</param> + <param>tcp://localhost:5445</param> + <param>tcp://localhost:5446</param> </args> <systemProperties> <property> @@ -176,11 +176,6 @@ <artifactId>jboss-jms-api</artifactId> <version>1.1.0.GA</version> </dependency> - <dependency> - <groupId>org.jboss.naming</groupId> - <artifactId>jnpserver</artifactId> - <version>5.0.3.GA</version> - </dependency> </dependencies> <configuration> <waitOnStart>false</waitOnStart> http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/client-side-load-balancing/src/main/java/org/apache/activemq/jms/example/ClientSideLoadBalancingExample.java ---------------------------------------------------------------------- diff --git a/examples/jms/client-side-load-balancing/src/main/java/org/apache/activemq/jms/example/ClientSideLoadBalancingExample.java b/examples/jms/client-side-load-balancing/src/main/java/org/apache/activemq/jms/example/ClientSideLoadBalancingExample.java index da73900..be1895a 100644 --- a/examples/jms/client-side-load-balancing/src/main/java/org/apache/activemq/jms/example/ClientSideLoadBalancingExample.java +++ b/examples/jms/client-side-load-balancing/src/main/java/org/apache/activemq/jms/example/ClientSideLoadBalancingExample.java @@ -59,10 +59,10 @@ public class ClientSideLoadBalancingExample extends ActiveMQExample initialContext = getContext(0); // Step 2. Look-up the JMS Queue object from JNDI - Queue queue = (Queue)initialContext.lookup("/queue/exampleQueue"); + Queue queue = (Queue)initialContext.lookup("queue/exampleQueue"); // Step 3. Look-up a JMS Connection Factory object from JNDI on server 0 - ConnectionFactory connectionFactory = (ConnectionFactory)initialContext.lookup("/ConnectionFactory"); + ConnectionFactory connectionFactory = (ConnectionFactory)initialContext.lookup("ConnectionFactory"); // Step 4. We create 3 JMS connections from the same connection factory. Since we are using round-robin // load-balancing this should result in each sessions being connected to a different node of the cluster http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/client-side-load-balancing/src/main/resources/hornetq/server0/activemq-jms.xml ---------------------------------------------------------------------- diff --git a/examples/jms/client-side-load-balancing/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/client-side-load-balancing/src/main/resources/hornetq/server0/activemq-jms.xml index 1ecf1f7..847659f 100644 --- a/examples/jms/client-side-load-balancing/src/main/resources/hornetq/server0/activemq-jms.xml +++ b/examples/jms/client-side-load-balancing/src/main/resources/hornetq/server0/activemq-jms.xml @@ -1,17 +1,8 @@ <configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd"> - <!--the connection factory used by the example--> - <connection-factory name="ConnectionFactory"> - <discovery-group-ref discovery-group-name="my-discovery-group"/> - <entries> - <entry name="ConnectionFactory"/> - </entries> - </connection-factory> <!--the queue used by the example--> - <queue name="exampleQueue"> - <entry name="/queue/exampleQueue"/> - </queue> + <queue name="exampleQueue"/> </configuration> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/client-side-load-balancing/src/main/resources/hornetq/server1/activemq-jms.xml ---------------------------------------------------------------------- diff --git a/examples/jms/client-side-load-balancing/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/client-side-load-balancing/src/main/resources/hornetq/server1/activemq-jms.xml index 1ecf1f7..847659f 100644 --- a/examples/jms/client-side-load-balancing/src/main/resources/hornetq/server1/activemq-jms.xml +++ b/examples/jms/client-side-load-balancing/src/main/resources/hornetq/server1/activemq-jms.xml @@ -1,17 +1,8 @@ <configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd"> - <!--the connection factory used by the example--> - <connection-factory name="ConnectionFactory"> - <discovery-group-ref discovery-group-name="my-discovery-group"/> - <entries> - <entry name="ConnectionFactory"/> - </entries> - </connection-factory> <!--the queue used by the example--> - <queue name="exampleQueue"> - <entry name="/queue/exampleQueue"/> - </queue> + <queue name="exampleQueue"/> </configuration> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/client-side-load-balancing/src/main/resources/hornetq/server2/activemq-jms.xml ---------------------------------------------------------------------- diff --git a/examples/jms/client-side-load-balancing/src/main/resources/hornetq/server2/activemq-jms.xml b/examples/jms/client-side-load-balancing/src/main/resources/hornetq/server2/activemq-jms.xml index 1ecf1f7..847659f 100644 --- a/examples/jms/client-side-load-balancing/src/main/resources/hornetq/server2/activemq-jms.xml +++ b/examples/jms/client-side-load-balancing/src/main/resources/hornetq/server2/activemq-jms.xml @@ -1,17 +1,8 @@ <configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd"> - <!--the connection factory used by the example--> - <connection-factory name="ConnectionFactory"> - <discovery-group-ref discovery-group-name="my-discovery-group"/> - <entries> - <entry name="ConnectionFactory"/> - </entries> - </connection-factory> <!--the queue used by the example--> - <queue name="exampleQueue"> - <entry name="/queue/exampleQueue"/> - </queue> + <queue name="exampleQueue"/> </configuration> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/clustered-durable-subscription/pom.xml ---------------------------------------------------------------------- diff --git a/examples/jms/clustered-durable-subscription/pom.xml b/examples/jms/clustered-durable-subscription/pom.xml index 5ff2e28..73d6727 100644 --- a/examples/jms/clustered-durable-subscription/pom.xml +++ b/examples/jms/clustered-durable-subscription/pom.xml @@ -79,8 +79,8 @@ <configuration> <clientClass>org.apache.activemq.jms.example.ClusteredDurableSubscriptionExample</clientClass> <args> - <param>jnp://localhost:1099</param> - <param>jnp://localhost:1199</param> + <param>tcp://localhost:5445</param> + <param>tcp://localhost:5446</param> </args> <systemProperties> <property> @@ -145,11 +145,6 @@ <artifactId>jboss-jms-api</artifactId> <version>1.1.0.GA</version> </dependency> - <dependency> - <groupId>org.jboss.naming</groupId> - <artifactId>jnpserver</artifactId> - <version>5.0.3.GA</version> - </dependency> </dependencies> <configuration> <waitOnStart>false</waitOnStart> http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/clustered-durable-subscription/src/main/java/org/apache/activemq/jms/example/ClusteredDurableSubscriptionExample.java ---------------------------------------------------------------------- diff --git a/examples/jms/clustered-durable-subscription/src/main/java/org/apache/activemq/jms/example/ClusteredDurableSubscriptionExample.java b/examples/jms/clustered-durable-subscription/src/main/java/org/apache/activemq/jms/example/ClusteredDurableSubscriptionExample.java index 5ca0f0d..01d1c47 100644 --- a/examples/jms/clustered-durable-subscription/src/main/java/org/apache/activemq/jms/example/ClusteredDurableSubscriptionExample.java +++ b/examples/jms/clustered-durable-subscription/src/main/java/org/apache/activemq/jms/example/ClusteredDurableSubscriptionExample.java @@ -59,16 +59,16 @@ public class ClusteredDurableSubscriptionExample extends ActiveMQExample ic0 = getContext(0); // Step 2. Look-up the JMS Topic object from JNDI - Topic topic = (Topic)ic0.lookup("/topic/exampleTopic"); + Topic topic = (Topic)ic0.lookup("topic/exampleTopic"); // Step 3. Look-up a JMS Connection Factory object from JNDI on server 0 - ConnectionFactory cf0 = (ConnectionFactory)ic0.lookup("/ConnectionFactory"); + ConnectionFactory cf0 = (ConnectionFactory)ic0.lookup("ConnectionFactory"); // Step 4. Get an initial context for looking up JNDI from server 1 ic1 = getContext(1); // Step 5. Look-up a JMS Connection Factory object from JNDI on server 1 - ConnectionFactory cf1 = (ConnectionFactory)ic1.lookup("/ConnectionFactory"); + ConnectionFactory cf1 = (ConnectionFactory)ic1.lookup("ConnectionFactory"); // Step 6. We create a JMS Connection connection0 which is a connection to server 0 // and set the client-id http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/clustered-durable-subscription/src/main/resources/hornetq/server0/activemq-jms.xml ---------------------------------------------------------------------- diff --git a/examples/jms/clustered-durable-subscription/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/clustered-durable-subscription/src/main/resources/hornetq/server0/activemq-jms.xml index 1dd09a6..ab4841d 100644 --- a/examples/jms/clustered-durable-subscription/src/main/resources/hornetq/server0/activemq-jms.xml +++ b/examples/jms/clustered-durable-subscription/src/main/resources/hornetq/server0/activemq-jms.xml @@ -1,19 +1,8 @@ <configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd"> - <!--the connection factory used by the example--> - <connection-factory name="ConnectionFactory"> - <connectors> - <connector-ref connector-name="netty-connector"/> - </connectors> - <entries> - <entry name="ConnectionFactory"/> - </entries> - </connection-factory> <!--the topic used by the example--> - <topic name="exampleTopic"> - <entry name="/topic/exampleTopic"/> - </topic> + <topic name="exampleTopic"/> </configuration> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/clustered-durable-subscription/src/main/resources/hornetq/server1/activemq-jms.xml ---------------------------------------------------------------------- diff --git a/examples/jms/clustered-durable-subscription/src/main/resources/hornetq/server1/activemq-jms.xml b/examples/jms/clustered-durable-subscription/src/main/resources/hornetq/server1/activemq-jms.xml index 1dd09a6..ab4841d 100644 --- a/examples/jms/clustered-durable-subscription/src/main/resources/hornetq/server1/activemq-jms.xml +++ b/examples/jms/clustered-durable-subscription/src/main/resources/hornetq/server1/activemq-jms.xml @@ -1,19 +1,8 @@ <configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd"> - <!--the connection factory used by the example--> - <connection-factory name="ConnectionFactory"> - <connectors> - <connector-ref connector-name="netty-connector"/> - </connectors> - <entries> - <entry name="ConnectionFactory"/> - </entries> - </connection-factory> <!--the topic used by the example--> - <topic name="exampleTopic"> - <entry name="/topic/exampleTopic"/> - </topic> + <topic name="exampleTopic"/> </configuration> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/clustered-grouping/pom.xml ---------------------------------------------------------------------- diff --git a/examples/jms/clustered-grouping/pom.xml b/examples/jms/clustered-grouping/pom.xml index 0e55226..f3a3fa6 100644 --- a/examples/jms/clustered-grouping/pom.xml +++ b/examples/jms/clustered-grouping/pom.xml @@ -101,9 +101,9 @@ <configuration> <clientClass>org.apache.activemq.jms.example.ClusteredGroupingExample</clientClass> <args> - <param>jnp://localhost:1099</param> - <param>jnp://localhost:1199</param> - <param>jnp://localhost:1299</param> + <param>tcp://localhost:5445</param> + <param>tcp://localhost:5446</param> + <param>tcp://localhost:5447</param> </args> <systemProperties> <property> @@ -177,11 +177,6 @@ <artifactId>jboss-jms-api</artifactId> <version>1.1.0.GA</version> </dependency> - <dependency> - <groupId>org.jboss.naming</groupId> - <artifactId>jnpserver</artifactId> - <version>5.0.3.GA</version> - </dependency> </dependencies> <configuration> <waitOnStart>false</waitOnStart> http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/clustered-grouping/src/main/java/org/apache/activemq/jms/example/ClusteredGroupingExample.java ---------------------------------------------------------------------- diff --git a/examples/jms/clustered-grouping/src/main/java/org/apache/activemq/jms/example/ClusteredGroupingExample.java b/examples/jms/clustered-grouping/src/main/java/org/apache/activemq/jms/example/ClusteredGroupingExample.java index 0561d88..91421cf 100644 --- a/examples/jms/clustered-grouping/src/main/java/org/apache/activemq/jms/example/ClusteredGroupingExample.java +++ b/examples/jms/clustered-grouping/src/main/java/org/apache/activemq/jms/example/ClusteredGroupingExample.java @@ -61,22 +61,22 @@ public class ClusteredGroupingExample extends ActiveMQExample ic0 = getContext(0); // Step 2. Look-up the JMS Queue object from JNDI - Queue queue = (Queue)ic0.lookup("/queue/exampleQueue"); + Queue queue = (Queue)ic0.lookup("queue/exampleQueue"); // Step 3. Look-up a JMS Connection Factory object from JNDI on server 0 - ConnectionFactory cf0 = (ConnectionFactory)ic0.lookup("/ConnectionFactory"); + ConnectionFactory cf0 = (ConnectionFactory)ic0.lookup("ConnectionFactory"); // Step 4. Get an initial context for looking up JNDI from server 1 ic1 = getContext(1); // Step 5. Look-up a JMS Connection Factory object from JNDI on server 1 - ConnectionFactory cf1 = (ConnectionFactory)ic1.lookup("/ConnectionFactory"); + ConnectionFactory cf1 = (ConnectionFactory)ic1.lookup("ConnectionFactory"); // Step 4. Get an initial context for looking up JNDI from server 1 ic2 = getContext(2); // Step 5. Look-up a JMS Connection Factory object from JNDI on server 1 - ConnectionFactory cf2 = (ConnectionFactory)ic2.lookup("/ConnectionFactory"); + ConnectionFactory cf2 = (ConnectionFactory)ic2.lookup("ConnectionFactory"); // Step 6. We create a JMS Connection connection0 which is a connection to server 0 connection0 = cf0.createConnection(); http://git-wip-us.apache.org/repos/asf/activemq-6/blob/e6a3d3a0/examples/jms/clustered-grouping/src/main/resources/hornetq/server0/activemq-jms.xml ---------------------------------------------------------------------- diff --git a/examples/jms/clustered-grouping/src/main/resources/hornetq/server0/activemq-jms.xml b/examples/jms/clustered-grouping/src/main/resources/hornetq/server0/activemq-jms.xml index 452b958..847659f 100644 --- a/examples/jms/clustered-grouping/src/main/resources/hornetq/server0/activemq-jms.xml +++ b/examples/jms/clustered-grouping/src/main/resources/hornetq/server0/activemq-jms.xml @@ -1,19 +1,8 @@ <configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq /schema/activemq-jms.xsd"> - <!--the connection factory used by the example--> - <connection-factory name="ConnectionFactory"> - <connectors> - <connector-ref connector-name="netty-connector"/> - </connectors> - <entries> - <entry name="ConnectionFactory"/> - </entries> - </connection-factory> <!--the queue used by the example--> - <queue name="exampleQueue"> - <entry name="/queue/exampleQueue"/> - </queue> + <queue name="exampleQueue"/> </configuration> \ No newline at end of file
