ARTEMIS-602 Fix REST examples
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/beda16b0 Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/beda16b0 Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/beda16b0 Branch: refs/heads/master Commit: beda16b0505f201a89e8cfa3bdd3a3c4cd6dccd0 Parents: 9214f50 Author: jbertram <[email protected]> Authored: Thu Jun 30 13:04:04 2016 -0500 Committer: Clebert Suconic <[email protected]> Committed: Tue Jul 5 12:44:17 2016 -0400 ---------------------------------------------------------------------- artemis-distribution/pom.xml | 2 ++ artemis-distribution/src/main/assembly/dep.xml | 2 +- artemis-web/pom.xml | 2 ++ .../features/standard/rest/dup-send/README.txt | 2 +- .../features/standard/rest/dup-send/pom.xml | 21 ++--------- .../rest/dup-send/src/main/java/PostOrder.java | 2 +- .../dup-send/src/main/java/PostOrderWithId.java | 2 +- .../dup-send/src/main/java/ReceiveOrder.java | 2 +- .../src/main/resources/activemq-client.xml | 36 ------------------- .../src/main/resources/artemis-roles.properties | 17 --------- .../src/main/resources/artemis-users.properties | 17 --------- .../rest/dup-send/src/main/resources/broker.xml | 23 +----------- .../dup-send/src/main/webapp/WEB-INF/web.xml | 4 +-- .../standard/rest/javascript-chat/README.txt | 4 +-- .../standard/rest/javascript-chat/pom.xml | 21 ++--------- .../src/main/resources/artemis-roles.properties | 17 --------- .../src/main/resources/artemis-users.properties | 17 --------- .../src/main/resources/broker.xml | 22 +----------- .../src/main/webapp/WEB-INF/web.xml | 4 +-- .../messaging/test/AutoAckTopicTest.java | 2 +- .../standard/rest/jms-to-rest/README.txt | 2 +- .../features/standard/rest/jms-to-rest/pom.xml | 21 ++--------- .../standard/rest/jms-to-rest/postOrder.py | 6 ++-- .../standard/rest/jms-to-rest/receiveOrder.py | 12 +++---- .../jms-to-rest/src/main/java/JmsHelper.java | 38 -------------------- .../jms-to-rest/src/main/java/JmsReceive.java | 3 +- .../rest/jms-to-rest/src/main/java/JmsSend.java | 3 +- .../jms-to-rest/src/main/java/RestReceive.java | 2 +- .../jms-to-rest/src/main/java/RestSend.java | 2 +- .../src/main/resources/activemq-client.xml | 36 ------------------- .../src/main/resources/artemis-roles.properties | 17 --------- .../src/main/resources/artemis-users.properties | 17 --------- .../jms-to-rest/src/main/resources/broker.xml | 24 ++----------- .../jms-to-rest/src/main/webapp/WEB-INF/web.xml | 4 +-- examples/features/standard/rest/push/README.txt | 2 +- examples/features/standard/rest/push/pom.xml | 20 ++--------- .../rest/push/src/main/java/JmsHelper.java | 37 ------------------- .../rest/push/src/main/java/PostOrder.java | 3 +- .../rest/push/src/main/java/PushReg.java | 12 ++----- .../push/src/main/java/ReceiveShipping.java | 3 +- .../push/src/main/resources/activemq-client.xml | 36 ------------------- .../src/main/resources/artemis-roles.properties | 17 --------- .../src/main/resources/artemis-users.properties | 17 --------- .../rest/push/src/main/resources/broker.xml | 22 +----------- .../src/main/resources/test-realm.properties | 18 ---------- .../rest/push/src/main/webapp/WEB-INF/web.xml | 23 ++---------- pom.xml | 4 ++- 47 files changed, 63 insertions(+), 557 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/artemis-distribution/pom.xml ---------------------------------------------------------------------- diff --git a/artemis-distribution/pom.xml b/artemis-distribution/pom.xml index 9346924..0faa449 100644 --- a/artemis-distribution/pom.xml +++ b/artemis-distribution/pom.xml @@ -158,6 +158,8 @@ <dependency> <groupId>org.eclipse.jetty.aggregate</groupId> <artifactId>jetty-all</artifactId> + <type>jar</type> + <classifier>uber</classifier> </dependency> <dependency> <groupId>org.apache.tomcat</groupId> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/artemis-distribution/src/main/assembly/dep.xml ---------------------------------------------------------------------- diff --git a/artemis-distribution/src/main/assembly/dep.xml b/artemis-distribution/src/main/assembly/dep.xml index 4a0f2da..0feb531 100644 --- a/artemis-distribution/src/main/assembly/dep.xml +++ b/artemis-distribution/src/main/assembly/dep.xml @@ -85,7 +85,7 @@ <include>io.airlift:airline</include> <include>com.google.guava:guava</include> <include>javax.inject:javax.inject</include> - <include>org.eclipse.jetty.aggregate:jetty-all</include> + <include>org.eclipse.jetty.aggregate:jetty-all:jar:uber</include> <include>org.apache.tomcat:tomcat-servlet-api</include> <include>commons-beanutils:commons-beanutils</include> <include>commons-logging:commons-logging</include> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/artemis-web/pom.xml ---------------------------------------------------------------------- diff --git a/artemis-web/pom.xml b/artemis-web/pom.xml index 2814841..aa27339 100644 --- a/artemis-web/pom.xml +++ b/artemis-web/pom.xml @@ -51,6 +51,8 @@ <dependency> <groupId>org.eclipse.jetty.aggregate</groupId> <artifactId>jetty-all</artifactId> + <type>jar</type> + <classifier>uber</classifier> </dependency> <dependency> <groupId>junit</groupId> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/dup-send/README.txt ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/dup-send/README.txt b/examples/features/standard/rest/dup-send/README.txt index 0e794b8..2ae6d0d 100644 --- a/examples/features/standard/rest/dup-send/README.txt +++ b/examples/features/standard/rest/dup-send/README.txt @@ -1,5 +1,5 @@ System Requirements: -You will need JDK 1.6 and Maven to run this example. This example has been tested with Maven 2.2.1. It may or may not work +You will need JDK 1.8 and Maven to run this example. This example has been tested with Maven 3.3.3. It may or may not work with earlier or later versions of Maven. http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/dup-send/pom.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/dup-send/pom.xml b/examples/features/standard/rest/dup-send/pom.xml index 724fccc..a016380 100644 --- a/examples/features/standard/rest/dup-send/pom.xml +++ b/examples/features/standard/rest/dup-send/pom.xml @@ -33,13 +33,6 @@ under the License. <activemq.basedir>${project.basedir}/../../../../..</activemq.basedir> </properties> - <repositories> - <repository> - <id>jboss</id> - <url>http://repository.jboss.org/nexus/content/groups/public/</url> - </repository> - </repositories> - <profiles> <profile> <id>example</id> @@ -78,21 +71,13 @@ under the License. </executions> </plugin> <plugin> - <groupId>org.mortbay.jetty</groupId> - <artifactId>maven-jetty-plugin</artifactId> - <version>6.1.15</version> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-maven-plugin</artifactId> + <version>${jetty.version}</version> <configuration> - <!-- By default the artifactId is taken, override it with something simple --> - <contextPath>/</contextPath> <scanIntervalSeconds>2</scanIntervalSeconds> <stopKey>foo</stopKey> <stopPort>9999</stopPort> - <connectors> - <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector"> - <port>9095</port> - <maxIdleTime>60000</maxIdleTime> - </connector> - </connectors> </configuration> <executions> <execution> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/dup-send/src/main/java/PostOrder.java ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/dup-send/src/main/java/PostOrder.java b/examples/features/standard/rest/dup-send/src/main/java/PostOrder.java index a864e44..dfa37fe 100644 --- a/examples/features/standard/rest/dup-send/src/main/java/PostOrder.java +++ b/examples/features/standard/rest/dup-send/src/main/java/PostOrder.java @@ -23,7 +23,7 @@ public class PostOrder { public static void main(String[] args) throws Exception { // first get the create URL for the shipping queue - ClientRequest request = new ClientRequest("http://localhost:9095/queues/jms.queue.orders"); + ClientRequest request = new ClientRequest("http://localhost:8080/queues/jms.queue.orders"); ClientResponse res = request.head(); Link create = res.getHeaderAsLink("msg-create"); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/dup-send/src/main/java/PostOrderWithId.java ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/dup-send/src/main/java/PostOrderWithId.java b/examples/features/standard/rest/dup-send/src/main/java/PostOrderWithId.java index 6b610e7..2e87398 100644 --- a/examples/features/standard/rest/dup-send/src/main/java/PostOrderWithId.java +++ b/examples/features/standard/rest/dup-send/src/main/java/PostOrderWithId.java @@ -26,7 +26,7 @@ public class PostOrderWithId { throw new RuntimeException("You must pass in a parameter"); // first get the create URL for the shipping queue - ClientRequest request = new ClientRequest("http://localhost:9095/queues/jms.queue.orders"); + ClientRequest request = new ClientRequest("http://localhost:8080/queues/jms.queue.orders"); ClientResponse res = request.head(); Link create = res.getHeaderAsLink("msg-create-with-id"); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/dup-send/src/main/java/ReceiveOrder.java ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/dup-send/src/main/java/ReceiveOrder.java b/examples/features/standard/rest/dup-send/src/main/java/ReceiveOrder.java index a00d110..d6dcb81 100644 --- a/examples/features/standard/rest/dup-send/src/main/java/ReceiveOrder.java +++ b/examples/features/standard/rest/dup-send/src/main/java/ReceiveOrder.java @@ -23,7 +23,7 @@ public class ReceiveOrder { public static void main(String[] args) throws Exception { // first get the create URL for the shipping queue - ClientRequest request = new ClientRequest("http://localhost:9095/queues/jms.queue.orders"); + ClientRequest request = new ClientRequest("http://localhost:8080/queues/jms.queue.orders"); ClientResponse res = request.head(); Link pullConsumers = res.getHeaderAsLink("msg-pull-consumers"); res.releaseConnection(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/dup-send/src/main/resources/activemq-client.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/dup-send/src/main/resources/activemq-client.xml b/examples/features/standard/rest/dup-send/src/main/resources/activemq-client.xml deleted file mode 100644 index 6fe4547..0000000 --- a/examples/features/standard/rest/dup-send/src/main/resources/activemq-client.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version='1.0'?> -<!-- -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. ---> - -<configuration xmlns="urn:activemq" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd"> - - <jms xmlns="urn:activemq:jms"> - </jms> - - <core xmlns="urn:activemq:core"> - - <!-- Connectors --> - <connectors> - <connector name="netty-connector">tcp://localhost:61616</connector> - </connectors> - </core> - -</configuration> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/dup-send/src/main/resources/artemis-roles.properties ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/dup-send/src/main/resources/artemis-roles.properties b/examples/features/standard/rest/dup-send/src/main/resources/artemis-roles.properties deleted file mode 100644 index 4e2d44c..0000000 --- a/examples/features/standard/rest/dup-send/src/main/resources/artemis-roles.properties +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## Licensed to the Apache Software Foundation (ASF) under one or more -## contributor license agreements. See the NOTICE file distributed with -## this work for additional information regarding copyright ownership. -## The ASF licenses this file to You under the Apache License, Version 2.0 -## (the "License"); you may not use this file except in compliance with -## the License. You may obtain a copy of the License at -## -## http://www.apache.org/licenses/LICENSE-2.0 -## -## Unless required by applicable law or agreed to in writing, software -## distributed under the License is distributed on an "AS IS" BASIS, -## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -## See the License for the specific language governing permissions and -## limitations under the License. -## --------------------------------------------------------------------------- -guest=guest \ No newline at end of file http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/dup-send/src/main/resources/artemis-users.properties ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/dup-send/src/main/resources/artemis-users.properties b/examples/features/standard/rest/dup-send/src/main/resources/artemis-users.properties deleted file mode 100644 index 4e2d44c..0000000 --- a/examples/features/standard/rest/dup-send/src/main/resources/artemis-users.properties +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## Licensed to the Apache Software Foundation (ASF) under one or more -## contributor license agreements. See the NOTICE file distributed with -## this work for additional information regarding copyright ownership. -## The ASF licenses this file to You under the Apache License, Version 2.0 -## (the "License"); you may not use this file except in compliance with -## the License. You may obtain a copy of the License at -## -## http://www.apache.org/licenses/LICENSE-2.0 -## -## Unless required by applicable law or agreed to in writing, software -## distributed under the License is distributed on an "AS IS" BASIS, -## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -## See the License for the specific language governing permissions and -## limitations under the License. -## --------------------------------------------------------------------------- -guest=guest \ No newline at end of file http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/dup-send/src/main/resources/broker.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/dup-send/src/main/resources/broker.xml b/examples/features/standard/rest/dup-send/src/main/resources/broker.xml index 8cc0fa6..67b5fe5 100644 --- a/examples/features/standard/rest/dup-send/src/main/resources/broker.xml +++ b/examples/features/standard/rest/dup-send/src/main/resources/broker.xml @@ -28,32 +28,11 @@ under the License. </jms> <core xmlns="urn:activemq:core"> - <persistence-enabled>false</persistence-enabled> - <!-- Connectors --> - - <connectors> - <connector name="in-vm">vm://0</connector> - </connectors> + <security-enabled>false</security-enabled> <acceptors> <acceptor name="in-vm">vm://0</acceptor> - <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor> </acceptors> - - <!-- Other config --> - - <security-settings> - <!--security for example queue--> - <security-setting match="#"> - <permission type="createDurableQueue" roles="guest"/> - <permission type="deleteDurableQueue" roles="guest"/> - <permission type="createNonDurableQueue" roles="guest"/> - <permission type="deleteNonDurableQueue" roles="guest"/> - <permission type="consume" roles="guest"/> - <permission type="send" roles="guest"/> - </security-setting> - </security-settings> - </core> </configuration> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/dup-send/src/main/webapp/WEB-INF/web.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/dup-send/src/main/webapp/WEB-INF/web.xml b/examples/features/standard/rest/dup-send/src/main/webapp/WEB-INF/web.xml index ffb38b5..1d624cf 100644 --- a/examples/features/standard/rest/dup-send/src/main/webapp/WEB-INF/web.xml +++ b/examples/features/standard/rest/dup-send/src/main/webapp/WEB-INF/web.xml @@ -45,11 +45,11 @@ under the License. </listener> <listener> - <listener-class>org.apache.activemq.rest.integration.ActiveMQBootstrapListener</listener-class> + <listener-class>org.apache.activemq.artemis.rest.integration.ActiveMQBootstrapListener</listener-class> </listener> <listener> - <listener-class>org.apache.activemq.rest.integration.RestMessagingBootstrapListener</listener-class> + <listener-class>org.apache.activemq.artemis.rest.integration.RestMessagingBootstrapListener</listener-class> </listener> </web-app> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/javascript-chat/README.txt ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/javascript-chat/README.txt b/examples/features/standard/rest/javascript-chat/README.txt index ae0e57c..7e52e1b 100644 --- a/examples/features/standard/rest/javascript-chat/README.txt +++ b/examples/features/standard/rest/javascript-chat/README.txt @@ -1,5 +1,5 @@ System Requirements: -You will need JDK 1.6, Maven, and a browser to run this example. This example has been tested with Maven 2.2.1. It may or may not work +You will need JDK 1.8 and Maven to run this example. This example has been tested with Maven 3.3.3. It may or may not work with earlier or later versions of Maven. @@ -12,5 +12,5 @@ $ mvn jetty:run This will bring up ActiveMQ Artemis and the ActiveMQ Artemis REST Interface. Step 2: -Bring up two browsers and point them to http://localhost:9095. In the textbox type a message you want to send. Click +Bring up two browsers and point them to http://localhost:8080. In the textbox type a message you want to send. Click the "Click to send message" button and you'll see the message show up in both browser windows. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/javascript-chat/pom.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/javascript-chat/pom.xml b/examples/features/standard/rest/javascript-chat/pom.xml index b5efef9..0a389bb 100644 --- a/examples/features/standard/rest/javascript-chat/pom.xml +++ b/examples/features/standard/rest/javascript-chat/pom.xml @@ -33,13 +33,6 @@ under the License. <activemq.basedir>${project.basedir}/../../../../..</activemq.basedir> </properties> - <repositories> - <repository> - <id>jboss</id> - <url>http://repository.jboss.org/nexus/content/groups/public/</url> - </repository> - </repositories> - <profiles> <profile> <id>example</id> @@ -91,21 +84,13 @@ under the License. </executions> </plugin> <plugin> - <groupId>org.mortbay.jetty</groupId> - <artifactId>maven-jetty-plugin</artifactId> - <version>6.1.15</version> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-maven-plugin</artifactId> + <version>${jetty.version}</version> <configuration> - <!-- By default the artifactId is taken, override it with something simple --> - <contextPath>/</contextPath> <scanIntervalSeconds>2</scanIntervalSeconds> <stopKey>foo</stopKey> <stopPort>9999</stopPort> - <connectors> - <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector"> - <port>9095</port> - <maxIdleTime>60000</maxIdleTime> - </connector> - </connectors> </configuration> <executions> <execution> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/javascript-chat/src/main/resources/artemis-roles.properties ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/javascript-chat/src/main/resources/artemis-roles.properties b/examples/features/standard/rest/javascript-chat/src/main/resources/artemis-roles.properties deleted file mode 100644 index 4e2d44c..0000000 --- a/examples/features/standard/rest/javascript-chat/src/main/resources/artemis-roles.properties +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## Licensed to the Apache Software Foundation (ASF) under one or more -## contributor license agreements. See the NOTICE file distributed with -## this work for additional information regarding copyright ownership. -## The ASF licenses this file to You under the Apache License, Version 2.0 -## (the "License"); you may not use this file except in compliance with -## the License. You may obtain a copy of the License at -## -## http://www.apache.org/licenses/LICENSE-2.0 -## -## Unless required by applicable law or agreed to in writing, software -## distributed under the License is distributed on an "AS IS" BASIS, -## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -## See the License for the specific language governing permissions and -## limitations under the License. -## --------------------------------------------------------------------------- -guest=guest \ No newline at end of file http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/javascript-chat/src/main/resources/artemis-users.properties ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/javascript-chat/src/main/resources/artemis-users.properties b/examples/features/standard/rest/javascript-chat/src/main/resources/artemis-users.properties deleted file mode 100644 index 4e2d44c..0000000 --- a/examples/features/standard/rest/javascript-chat/src/main/resources/artemis-users.properties +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## Licensed to the Apache Software Foundation (ASF) under one or more -## contributor license agreements. See the NOTICE file distributed with -## this work for additional information regarding copyright ownership. -## The ASF licenses this file to You under the Apache License, Version 2.0 -## (the "License"); you may not use this file except in compliance with -## the License. You may obtain a copy of the License at -## -## http://www.apache.org/licenses/LICENSE-2.0 -## -## Unless required by applicable law or agreed to in writing, software -## distributed under the License is distributed on an "AS IS" BASIS, -## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -## See the License for the specific language governing permissions and -## limitations under the License. -## --------------------------------------------------------------------------- -guest=guest \ No newline at end of file http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/javascript-chat/src/main/resources/broker.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/javascript-chat/src/main/resources/broker.xml b/examples/features/standard/rest/javascript-chat/src/main/resources/broker.xml index e5e1364..c24bf62 100644 --- a/examples/features/standard/rest/javascript-chat/src/main/resources/broker.xml +++ b/examples/features/standard/rest/javascript-chat/src/main/resources/broker.xml @@ -28,31 +28,11 @@ under the License. </jms> <core xmlns="urn:activemq:core"> - <persistence-enabled>false</persistence-enabled> - <!-- Connectors --> - - <connectors> - <connector name="in-vm">vm://0</connector> - </connectors> + <security-enabled>false</security-enabled> <acceptors> <acceptor name="in-vm">vm://0</acceptor> </acceptors> - - <!-- Other config --> - - <security-settings> - <!--security for example queue--> - <security-setting match="#"> - <permission type="createDurableQueue" roles="guest"/> - <permission type="deleteDurableQueue" roles="guest"/> - <permission type="createNonDurableQueue" roles="guest"/> - <permission type="deleteNonDurableQueue" roles="guest"/> - <permission type="consume" roles="guest"/> - <permission type="send" roles="guest"/> - </security-setting> - </security-settings> - </core> </configuration> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/javascript-chat/src/main/webapp/WEB-INF/web.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/javascript-chat/src/main/webapp/WEB-INF/web.xml b/examples/features/standard/rest/javascript-chat/src/main/webapp/WEB-INF/web.xml index e82738a..d824c11 100644 --- a/examples/features/standard/rest/javascript-chat/src/main/webapp/WEB-INF/web.xml +++ b/examples/features/standard/rest/javascript-chat/src/main/webapp/WEB-INF/web.xml @@ -41,11 +41,11 @@ under the License. </listener> <listener> - <listener-class>org.apache.activemq.rest.integration.ActiveMQBootstrapListener</listener-class> + <listener-class>org.apache.activemq.artemis.rest.integration.ActiveMQBootstrapListener</listener-class> </listener> <listener> - <listener-class>org.apache.activemq.rest.integration.RestMessagingBootstrapListener</listener-class> + <listener-class>org.apache.activemq.artemis.rest.integration.RestMessagingBootstrapListener</listener-class> </listener> </web-app> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/javascript-chat/src/test/java/org/jboss/resteasy/messaging/test/AutoAckTopicTest.java ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/javascript-chat/src/test/java/org/jboss/resteasy/messaging/test/AutoAckTopicTest.java b/examples/features/standard/rest/javascript-chat/src/test/java/org/jboss/resteasy/messaging/test/AutoAckTopicTest.java index e1609bb..0a0d5ae 100644 --- a/examples/features/standard/rest/javascript-chat/src/test/java/org/jboss/resteasy/messaging/test/AutoAckTopicTest.java +++ b/examples/features/standard/rest/javascript-chat/src/test/java/org/jboss/resteasy/messaging/test/AutoAckTopicTest.java @@ -31,7 +31,7 @@ public class AutoAckTopicTest { //todo fix //@Test public void testSuccessFirst() throws Exception { - ClientRequest request = new ClientRequest("http://localhost:9095/topics/jms.topic.chat"); + ClientRequest request = new ClientRequest("http://localhost:8080/topics/jms.topic.chat"); ClientResponse response = request.head(); Assert.assertEquals("*****", 200, response.getStatus()); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/jms-to-rest/README.txt ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/jms-to-rest/README.txt b/examples/features/standard/rest/jms-to-rest/README.txt index f012d94..217bb3c 100644 --- a/examples/features/standard/rest/jms-to-rest/README.txt +++ b/examples/features/standard/rest/jms-to-rest/README.txt @@ -1,5 +1,5 @@ System Requirements: -You will need JDK 1.6 and Maven to run this example. This example has been tested with Maven 2.2.1. It may or may not work +You will need JDK 1.8 and Maven to run this example. This example has been tested with Maven 3.3.3. It may or may not work with earlier or later versions of Maven. http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/jms-to-rest/pom.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/jms-to-rest/pom.xml b/examples/features/standard/rest/jms-to-rest/pom.xml index e32e2f6..d19ca1f 100644 --- a/examples/features/standard/rest/jms-to-rest/pom.xml +++ b/examples/features/standard/rest/jms-to-rest/pom.xml @@ -33,13 +33,6 @@ under the License. <activemq.basedir>${project.basedir}/../../../../..</activemq.basedir> </properties> - <repositories> - <repository> - <id>jboss</id> - <url>http://repository.jboss.org/nexus/content/groups/public/</url> - </repository> - </repositories> - <profiles> <profile> <id>example</id> @@ -78,21 +71,13 @@ under the License. </executions> </plugin> <plugin> - <groupId>org.mortbay.jetty</groupId> - <artifactId>maven-jetty-plugin</artifactId> - <version>6.1.15</version> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-maven-plugin</artifactId> + <version>${jetty.version}</version> <configuration> - <!-- By default the artifactId is taken, override it with something simple --> - <contextPath>/</contextPath> <scanIntervalSeconds>2</scanIntervalSeconds> <stopKey>foo</stopKey> <stopPort>9999</stopPort> - <connectors> - <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector"> - <port>9095</port> - <maxIdleTime>60000</maxIdleTime> - </connector> - </connectors> </configuration> <executions> <execution> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/jms-to-rest/postOrder.py ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/jms-to-rest/postOrder.py b/examples/features/standard/rest/jms-to-rest/postOrder.py index 3580986..e0440f0 100644 --- a/examples/features/standard/rest/jms-to-rest/postOrder.py +++ b/examples/features/standard/rest/jms-to-rest/postOrder.py @@ -5,9 +5,9 @@ # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -16,7 +16,7 @@ # under the License. import httplib, urlparse -conn = httplib.HTTPConnection("localhost:9095") +conn = httplib.HTTPConnection("localhost:8080") conn.request("HEAD", "/queues/jms.queue.orders") res = conn.getresponse() createLink = res.getheader("msg-create") http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/jms-to-rest/receiveOrder.py ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/jms-to-rest/receiveOrder.py b/examples/features/standard/rest/jms-to-rest/receiveOrder.py index ce73f5c..076978b 100644 --- a/examples/features/standard/rest/jms-to-rest/receiveOrder.py +++ b/examples/features/standard/rest/jms-to-rest/receiveOrder.py @@ -5,9 +5,9 @@ # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -16,7 +16,7 @@ # under the License. import httplib, urlparse -conn = httplib.HTTPConnection("localhost:9095") +conn = httplib.HTTPConnection("localhost:8080") conn.request("HEAD", "/queues/jms.queue.orders") res = conn.getresponse() consumersLink = res.getheader("msg-pull-consumers") @@ -55,9 +55,9 @@ finally: conn = httplib.HTTPConnection(createParsed.netloc) conn.request("DELETE", createParsed.path) res = conn.getresponse() - - - + + + http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/jms-to-rest/src/main/java/JmsHelper.java ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/jms-to-rest/src/main/java/JmsHelper.java b/examples/features/standard/rest/jms-to-rest/src/main/java/JmsHelper.java deleted file mode 100644 index ef7a575..0000000 --- a/examples/features/standard/rest/jms-to-rest/src/main/java/JmsHelper.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import org.apache.activemq.artemis.api.core.TransportConfiguration; -import org.apache.activemq.artemis.api.core.client.ActiveMQClient; -import org.apache.activemq.artemis.core.config.FileDeploymentManager; -import org.apache.activemq.artemis.core.config.impl.FileConfiguration; -import org.apache.activemq.artemis.jms.client.ActiveMQJMSConnectionFactory; - -import javax.jms.ConnectionFactory; - -public class JmsHelper { - - public static ConnectionFactory createConnectionFactory(String configFile) throws Exception { - FileConfiguration config = new FileConfiguration(); - FileDeploymentManager deploymentManager = new FileDeploymentManager(configFile); - deploymentManager.addDeployable(config); - deploymentManager.readConfiguration(); - TransportConfiguration transport = config.getConnectorConfigurations().get("netty-connector"); - return new ActiveMQJMSConnectionFactory(ActiveMQClient.createServerLocatorWithoutHA(transport)); - - } - -} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/jms-to-rest/src/main/java/JmsReceive.java ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/jms-to-rest/src/main/java/JmsReceive.java b/examples/features/standard/rest/jms-to-rest/src/main/java/JmsReceive.java index ed121bc..455540c 100644 --- a/examples/features/standard/rest/jms-to-rest/src/main/java/JmsReceive.java +++ b/examples/features/standard/rest/jms-to-rest/src/main/java/JmsReceive.java @@ -16,6 +16,7 @@ */ import org.apache.activemq.artemis.jms.client.ActiveMQDestination; +import org.apache.activemq.artemis.jms.client.ActiveMQJMSConnectionFactory; import org.apache.activemq.artemis.rest.Jms; import javax.jms.Connection; @@ -30,7 +31,7 @@ public class JmsReceive { public static void main(String[] args) throws Exception { System.out.println("Receive Setup..."); - ConnectionFactory factory = JmsHelper.createConnectionFactory("activemq-client.xml"); + ConnectionFactory factory = new ActiveMQJMSConnectionFactory("tcp://localhost:61616"); Destination destination = ActiveMQDestination.fromAddress("jms.queue.orders"); try (Connection conn = factory.createConnection()) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/jms-to-rest/src/main/java/JmsSend.java ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/jms-to-rest/src/main/java/JmsSend.java b/examples/features/standard/rest/jms-to-rest/src/main/java/JmsSend.java index 73514a0..0cde207 100644 --- a/examples/features/standard/rest/jms-to-rest/src/main/java/JmsSend.java +++ b/examples/features/standard/rest/jms-to-rest/src/main/java/JmsSend.java @@ -16,6 +16,7 @@ */ import org.apache.activemq.artemis.jms.client.ActiveMQDestination; +import org.apache.activemq.artemis.jms.client.ActiveMQJMSConnectionFactory; import javax.jms.Connection; import javax.jms.ConnectionFactory; @@ -27,7 +28,7 @@ import javax.jms.Session; public class JmsSend { public static void main(String[] args) throws Exception { - ConnectionFactory factory = JmsHelper.createConnectionFactory("activemq-client.xml"); + ConnectionFactory factory = new ActiveMQJMSConnectionFactory("tcp://localhost:61616"); Destination destination = ActiveMQDestination.fromAddress("jms.queue.orders"); try (Connection conn = factory.createConnection()) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/jms-to-rest/src/main/java/RestReceive.java ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/jms-to-rest/src/main/java/RestReceive.java b/examples/features/standard/rest/jms-to-rest/src/main/java/RestReceive.java index 4fc493a..a4754d0 100644 --- a/examples/features/standard/rest/jms-to-rest/src/main/java/RestReceive.java +++ b/examples/features/standard/rest/jms-to-rest/src/main/java/RestReceive.java @@ -23,7 +23,7 @@ public class RestReceive { public static void main(String[] args) throws Exception { // first get the create URL for the shipping queue - ClientRequest request = new ClientRequest("http://localhost:9095/queues/jms.queue.orders"); + ClientRequest request = new ClientRequest("http://localhost:8080/queues/jms.queue.orders"); ClientResponse res = request.head(); Link pullConsumers = res.getHeaderAsLink("msg-pull-consumers"); res = pullConsumers.request().formParameter("autoAck", "false").post(); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/jms-to-rest/src/main/java/RestSend.java ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/jms-to-rest/src/main/java/RestSend.java b/examples/features/standard/rest/jms-to-rest/src/main/java/RestSend.java index 902c4f7..e9649ac 100644 --- a/examples/features/standard/rest/jms-to-rest/src/main/java/RestSend.java +++ b/examples/features/standard/rest/jms-to-rest/src/main/java/RestSend.java @@ -23,7 +23,7 @@ public class RestSend { public static void main(String[] args) throws Exception { // first get the create URL for the shipping queue - ClientRequest request = new ClientRequest("http://localhost:9095/queues/jms.queue.orders"); + ClientRequest request = new ClientRequest("http://localhost:8080/queues/jms.queue.orders"); ClientResponse res = request.head(); Link create = res.getHeaderAsLink("msg-create"); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/jms-to-rest/src/main/resources/activemq-client.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/jms-to-rest/src/main/resources/activemq-client.xml b/examples/features/standard/rest/jms-to-rest/src/main/resources/activemq-client.xml deleted file mode 100644 index 6fe4547..0000000 --- a/examples/features/standard/rest/jms-to-rest/src/main/resources/activemq-client.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version='1.0'?> -<!-- -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. ---> - -<configuration xmlns="urn:activemq" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd"> - - <jms xmlns="urn:activemq:jms"> - </jms> - - <core xmlns="urn:activemq:core"> - - <!-- Connectors --> - <connectors> - <connector name="netty-connector">tcp://localhost:61616</connector> - </connectors> - </core> - -</configuration> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/jms-to-rest/src/main/resources/artemis-roles.properties ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/jms-to-rest/src/main/resources/artemis-roles.properties b/examples/features/standard/rest/jms-to-rest/src/main/resources/artemis-roles.properties deleted file mode 100644 index 4e2d44c..0000000 --- a/examples/features/standard/rest/jms-to-rest/src/main/resources/artemis-roles.properties +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## Licensed to the Apache Software Foundation (ASF) under one or more -## contributor license agreements. See the NOTICE file distributed with -## this work for additional information regarding copyright ownership. -## The ASF licenses this file to You under the Apache License, Version 2.0 -## (the "License"); you may not use this file except in compliance with -## the License. You may obtain a copy of the License at -## -## http://www.apache.org/licenses/LICENSE-2.0 -## -## Unless required by applicable law or agreed to in writing, software -## distributed under the License is distributed on an "AS IS" BASIS, -## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -## See the License for the specific language governing permissions and -## limitations under the License. -## --------------------------------------------------------------------------- -guest=guest \ No newline at end of file http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/jms-to-rest/src/main/resources/artemis-users.properties ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/jms-to-rest/src/main/resources/artemis-users.properties b/examples/features/standard/rest/jms-to-rest/src/main/resources/artemis-users.properties deleted file mode 100644 index 4e2d44c..0000000 --- a/examples/features/standard/rest/jms-to-rest/src/main/resources/artemis-users.properties +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## Licensed to the Apache Software Foundation (ASF) under one or more -## contributor license agreements. See the NOTICE file distributed with -## this work for additional information regarding copyright ownership. -## The ASF licenses this file to You under the Apache License, Version 2.0 -## (the "License"); you may not use this file except in compliance with -## the License. You may obtain a copy of the License at -## -## http://www.apache.org/licenses/LICENSE-2.0 -## -## Unless required by applicable law or agreed to in writing, software -## distributed under the License is distributed on an "AS IS" BASIS, -## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -## See the License for the specific language governing permissions and -## limitations under the License. -## --------------------------------------------------------------------------- -guest=guest \ No newline at end of file http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/jms-to-rest/src/main/resources/broker.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/jms-to-rest/src/main/resources/broker.xml b/examples/features/standard/rest/jms-to-rest/src/main/resources/broker.xml index 8cc0fa6..f8de5c4 100644 --- a/examples/features/standard/rest/jms-to-rest/src/main/resources/broker.xml +++ b/examples/features/standard/rest/jms-to-rest/src/main/resources/broker.xml @@ -28,32 +28,12 @@ under the License. </jms> <core xmlns="urn:activemq:core"> - <persistence-enabled>false</persistence-enabled> - <!-- Connectors --> - - <connectors> - <connector name="in-vm">vm://0</connector> - </connectors> + <security-enabled>false</security-enabled> <acceptors> <acceptor name="in-vm">vm://0</acceptor> - <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor> + <acceptor name="netty">tcp://localhost:61616</acceptor> </acceptors> - - <!-- Other config --> - - <security-settings> - <!--security for example queue--> - <security-setting match="#"> - <permission type="createDurableQueue" roles="guest"/> - <permission type="deleteDurableQueue" roles="guest"/> - <permission type="createNonDurableQueue" roles="guest"/> - <permission type="deleteNonDurableQueue" roles="guest"/> - <permission type="consume" roles="guest"/> - <permission type="send" roles="guest"/> - </security-setting> - </security-settings> - </core> </configuration> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/jms-to-rest/src/main/webapp/WEB-INF/web.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/jms-to-rest/src/main/webapp/WEB-INF/web.xml b/examples/features/standard/rest/jms-to-rest/src/main/webapp/WEB-INF/web.xml index e82738a..d824c11 100644 --- a/examples/features/standard/rest/jms-to-rest/src/main/webapp/WEB-INF/web.xml +++ b/examples/features/standard/rest/jms-to-rest/src/main/webapp/WEB-INF/web.xml @@ -41,11 +41,11 @@ under the License. </listener> <listener> - <listener-class>org.apache.activemq.rest.integration.ActiveMQBootstrapListener</listener-class> + <listener-class>org.apache.activemq.artemis.rest.integration.ActiveMQBootstrapListener</listener-class> </listener> <listener> - <listener-class>org.apache.activemq.rest.integration.RestMessagingBootstrapListener</listener-class> + <listener-class>org.apache.activemq.artemis.rest.integration.RestMessagingBootstrapListener</listener-class> </listener> </web-app> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/push/README.txt ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/push/README.txt b/examples/features/standard/rest/push/README.txt index 307e444..c5c0f3a 100644 --- a/examples/features/standard/rest/push/README.txt +++ b/examples/features/standard/rest/push/README.txt @@ -1,5 +1,5 @@ System Requirements: -You will need JDK 1.6 and Maven to run this example. This example has been tested with Maven 2.2.1. It may or may not work +You will need JDK 1.8 and Maven to run this example. This example has been tested with Maven 3.3.3. It may or may not work with earlier or later versions of Maven. http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/push/pom.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/push/pom.xml b/examples/features/standard/rest/push/pom.xml index 00c551c..fab1240 100644 --- a/examples/features/standard/rest/push/pom.xml +++ b/examples/features/standard/rest/push/pom.xml @@ -78,27 +78,13 @@ under the License. </executions> </plugin> <plugin> - <groupId>org.mortbay.jetty</groupId> - <artifactId>maven-jetty-plugin</artifactId> - <version>6.1.15</version> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-maven-plugin</artifactId> + <version>${jetty.version}</version> <configuration> - <!-- By default the artifactId is taken, override it with something simple --> - <contextPath>/</contextPath> <scanIntervalSeconds>2</scanIntervalSeconds> <stopKey>foo</stopKey> <stopPort>9999</stopPort> - <connectors> - <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector"> - <port>9095</port> - <maxIdleTime>60000</maxIdleTime> - </connector> - </connectors> - <userRealms> - <userRealm implementation="org.mortbay.jetty.security.HashUserRealm"> - <name>Test</name> - <config>${project.build.outputDirectory}/test-realm.properties</config> - </userRealm> - </userRealms> </configuration> <executions> <execution> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/push/src/main/java/JmsHelper.java ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/push/src/main/java/JmsHelper.java b/examples/features/standard/rest/push/src/main/java/JmsHelper.java deleted file mode 100644 index add00c2..0000000 --- a/examples/features/standard/rest/push/src/main/java/JmsHelper.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import org.apache.activemq.artemis.api.core.TransportConfiguration; -import org.apache.activemq.artemis.api.core.client.ActiveMQClient; -import org.apache.activemq.artemis.core.config.FileDeploymentManager; -import org.apache.activemq.artemis.core.config.impl.FileConfiguration; -import org.apache.activemq.artemis.jms.client.ActiveMQJMSConnectionFactory; - -import javax.jms.ConnectionFactory; - -public class JmsHelper { - - public static ConnectionFactory createConnectionFactory(String configFile) throws Exception { - FileConfiguration config = new FileConfiguration(); - FileDeploymentManager deploymentManager = new FileDeploymentManager(configFile); - deploymentManager.addDeployable(config); - deploymentManager.readConfiguration(); - TransportConfiguration transport = config.getConnectorConfigurations().get("netty-connector"); - return new ActiveMQJMSConnectionFactory(ActiveMQClient.createServerLocatorWithoutHA(transport)); - - } -} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/push/src/main/java/PostOrder.java ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/push/src/main/java/PostOrder.java b/examples/features/standard/rest/push/src/main/java/PostOrder.java index b3885b6..b37adf7 100644 --- a/examples/features/standard/rest/push/src/main/java/PostOrder.java +++ b/examples/features/standard/rest/push/src/main/java/PostOrder.java @@ -16,6 +16,7 @@ */ import org.apache.activemq.artemis.jms.client.ActiveMQDestination; +import org.apache.activemq.artemis.jms.client.ActiveMQJMSConnectionFactory; import javax.jms.Connection; import javax.jms.ConnectionFactory; @@ -27,7 +28,7 @@ import javax.jms.Session; public class PostOrder { public static void main(String[] args) throws Exception { - ConnectionFactory factory = JmsHelper.createConnectionFactory("activemq-client.xml"); + ConnectionFactory factory = new ActiveMQJMSConnectionFactory("tcp://localhost:61616"); Destination destination = ActiveMQDestination.fromAddress("jms.queue.orders"); try (Connection conn = factory.createConnection()) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/push/src/main/java/PushReg.java ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/push/src/main/java/PushReg.java b/examples/features/standard/rest/push/src/main/java/PushReg.java index 2567826..05466d6 100644 --- a/examples/features/standard/rest/push/src/main/java/PushReg.java +++ b/examples/features/standard/rest/push/src/main/java/PushReg.java @@ -15,8 +15,6 @@ * limitations under the License. */ -import org.apache.activemq.artemis.rest.queue.push.xml.Authentication; -import org.apache.activemq.artemis.rest.queue.push.xml.BasicAuth; import org.apache.activemq.artemis.rest.queue.push.xml.PushRegistration; import org.apache.activemq.artemis.rest.queue.push.xml.XmlLink; import org.jboss.resteasy.client.ClientRequest; @@ -27,21 +25,15 @@ public class PushReg { public static void main(String[] args) throws Exception { // get the push consumers factory resource - ClientRequest request = new ClientRequest("http://localhost:9095/queues/jms.queue.orders"); + ClientRequest request = new ClientRequest("http://localhost:8080/queues/jms.queue.orders"); ClientResponse res = request.head(); Link pushConsumers = res.getHeaderAsLink("msg-push-consumers"); // next create the XML document that represents the registration // Really, just create a link with the shipping URL and the type you want posted PushRegistration reg = new PushRegistration(); - BasicAuth authType = new BasicAuth(); - authType.setUsername("guest"); - authType.setPassword("guest"); - Authentication auth = new Authentication(); - auth.setType(authType); - reg.setAuthenticationMechanism(auth); XmlLink target = new XmlLink(); - target.setHref("http://localhost:9095/queues/jms.queue.shipping"); + target.setHref("http://localhost:8080/queues/jms.queue.shipping"); target.setType("application/xml"); target.setRelationship("destination"); reg.setTarget(target); http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/push/src/main/java/ReceiveShipping.java ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/push/src/main/java/ReceiveShipping.java b/examples/features/standard/rest/push/src/main/java/ReceiveShipping.java index 6ffed38..b82bbe8 100644 --- a/examples/features/standard/rest/push/src/main/java/ReceiveShipping.java +++ b/examples/features/standard/rest/push/src/main/java/ReceiveShipping.java @@ -16,6 +16,7 @@ */ import org.apache.activemq.artemis.jms.client.ActiveMQDestination; +import org.apache.activemq.artemis.jms.client.ActiveMQJMSConnectionFactory; import org.apache.activemq.artemis.rest.Jms; import javax.jms.Connection; @@ -29,7 +30,7 @@ import javax.jms.Session; public class ReceiveShipping { public static void main(String[] args) throws Exception { - ConnectionFactory factory = JmsHelper.createConnectionFactory("activemq-client.xml"); + ConnectionFactory factory = new ActiveMQJMSConnectionFactory("tcp://localhost:61616"); Destination destination = ActiveMQDestination.fromAddress("jms.queue.shipping"); try (Connection conn = factory.createConnection()) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/push/src/main/resources/activemq-client.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/push/src/main/resources/activemq-client.xml b/examples/features/standard/rest/push/src/main/resources/activemq-client.xml deleted file mode 100644 index 6fe4547..0000000 --- a/examples/features/standard/rest/push/src/main/resources/activemq-client.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version='1.0'?> -<!-- -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. ---> - -<configuration xmlns="urn:activemq" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd"> - - <jms xmlns="urn:activemq:jms"> - </jms> - - <core xmlns="urn:activemq:core"> - - <!-- Connectors --> - <connectors> - <connector name="netty-connector">tcp://localhost:61616</connector> - </connectors> - </core> - -</configuration> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/push/src/main/resources/artemis-roles.properties ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/push/src/main/resources/artemis-roles.properties b/examples/features/standard/rest/push/src/main/resources/artemis-roles.properties deleted file mode 100644 index 4e2d44c..0000000 --- a/examples/features/standard/rest/push/src/main/resources/artemis-roles.properties +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## Licensed to the Apache Software Foundation (ASF) under one or more -## contributor license agreements. See the NOTICE file distributed with -## this work for additional information regarding copyright ownership. -## The ASF licenses this file to You under the Apache License, Version 2.0 -## (the "License"); you may not use this file except in compliance with -## the License. You may obtain a copy of the License at -## -## http://www.apache.org/licenses/LICENSE-2.0 -## -## Unless required by applicable law or agreed to in writing, software -## distributed under the License is distributed on an "AS IS" BASIS, -## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -## See the License for the specific language governing permissions and -## limitations under the License. -## --------------------------------------------------------------------------- -guest=guest \ No newline at end of file http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/push/src/main/resources/artemis-users.properties ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/push/src/main/resources/artemis-users.properties b/examples/features/standard/rest/push/src/main/resources/artemis-users.properties deleted file mode 100644 index 4e2d44c..0000000 --- a/examples/features/standard/rest/push/src/main/resources/artemis-users.properties +++ /dev/null @@ -1,17 +0,0 @@ -## --------------------------------------------------------------------------- -## Licensed to the Apache Software Foundation (ASF) under one or more -## contributor license agreements. See the NOTICE file distributed with -## this work for additional information regarding copyright ownership. -## The ASF licenses this file to You under the Apache License, Version 2.0 -## (the "License"); you may not use this file except in compliance with -## the License. You may obtain a copy of the License at -## -## http://www.apache.org/licenses/LICENSE-2.0 -## -## Unless required by applicable law or agreed to in writing, software -## distributed under the License is distributed on an "AS IS" BASIS, -## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -## See the License for the specific language governing permissions and -## limitations under the License. -## --------------------------------------------------------------------------- -guest=guest \ No newline at end of file http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/push/src/main/resources/broker.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/push/src/main/resources/broker.xml b/examples/features/standard/rest/push/src/main/resources/broker.xml index 13f2f23..c2b8515 100644 --- a/examples/features/standard/rest/push/src/main/resources/broker.xml +++ b/examples/features/standard/rest/push/src/main/resources/broker.xml @@ -29,32 +29,12 @@ under the License. </jms> <core xmlns="urn:activemq:core"> - <persistence-enabled>false</persistence-enabled> - <!-- Connectors --> - - <connectors> - <connector name="in-vm">vm://0</connector> - </connectors> + <security-enabled>false</security-enabled> <acceptors> <acceptor name="in-vm">vm://0</acceptor> <acceptor name="netty-acceptor">tcp://localhost:61616</acceptor> </acceptors> - - <!-- Other config --> - - <security-settings> - <!--security for example queue--> - <security-setting match="#"> - <permission type="createDurableQueue" roles="guest"/> - <permission type="deleteDurableQueue" roles="guest"/> - <permission type="createNonDurableQueue" roles="guest"/> - <permission type="deleteNonDurableQueue" roles="guest"/> - <permission type="consume" roles="guest"/> - <permission type="send" roles="guest"/> - </security-setting> - </security-settings> - </core> </configuration> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/push/src/main/resources/test-realm.properties ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/push/src/main/resources/test-realm.properties b/examples/features/standard/rest/push/src/main/resources/test-realm.properties deleted file mode 100644 index 65f2dd9..0000000 --- a/examples/features/standard/rest/push/src/main/resources/test-realm.properties +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -guest: guest,admin http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/examples/features/standard/rest/push/src/main/webapp/WEB-INF/web.xml ---------------------------------------------------------------------- diff --git a/examples/features/standard/rest/push/src/main/webapp/WEB-INF/web.xml b/examples/features/standard/rest/push/src/main/webapp/WEB-INF/web.xml index d4ba92b..d824c11 100644 --- a/examples/features/standard/rest/push/src/main/webapp/WEB-INF/web.xml +++ b/examples/features/standard/rest/push/src/main/webapp/WEB-INF/web.xml @@ -41,30 +41,11 @@ under the License. </listener> <listener> - <listener-class>org.apache.activemq.rest.integration.ActiveMQBootstrapListener</listener-class> + <listener-class>org.apache.activemq.artemis.rest.integration.ActiveMQBootstrapListener</listener-class> </listener> <listener> - <listener-class>org.apache.activemq.rest.integration.RestMessagingBootstrapListener</listener-class> + <listener-class>org.apache.activemq.artemis.rest.integration.RestMessagingBootstrapListener</listener-class> </listener> - <security-constraint> - <web-resource-collection> - <web-resource-name>Resteasy</web-resource-name> - <url-pattern>/queues/jms.queue.shipping/*</url-pattern> - </web-resource-collection> - <auth-constraint> - <role-name>admin</role-name> - </auth-constraint> - </security-constraint> - - <login-config> - <auth-method>BASIC</auth-method> - <realm-name>Test</realm-name> - </login-config> - - <security-role> - <role-name>admin</role-name> - </security-role> - </web-app> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/beda16b0/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 4787de9..eb43c58 100644 --- a/pom.xml +++ b/pom.xml @@ -76,7 +76,7 @@ <fuse.mqtt.client.version>1.10</fuse.mqtt.client.version> <guava.version>18.0</guava.version> <jboss.logging.version>3.3.0.Final</jboss.logging.version> - <jetty.version>9.2.11.v20150529</jetty.version> + <jetty.version>9.3.10.v20160621</jetty.version> <jgroups.version>3.6.9.Final</jgroups.version> <maven.assembly.plugin.version>2.4</maven.assembly.plugin.version> <netty.version>4.0.32.Final</netty.version> @@ -517,6 +517,8 @@ <groupId>org.eclipse.jetty.aggregate</groupId> <artifactId>jetty-all</artifactId> <version>${jetty.version}</version> + <type>jar</type> + <classifier>uber</classifier> <!-- License: (Joint): Apache 2.0 & EPL 1.0 --> </dependency> <dependency>
