activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From martyntay...@apache.org
Subject [1/2] activemq-artemis git commit: ARTEMIS-537 - final improvements to OSGi integration and documentation update
Date Fri, 27 May 2016 15:51:44 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master fdaf9b22f -> a888d6b8f


ARTEMIS-537 - final improvements to OSGi integration and documentation update


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/d891e477
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/d891e477
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/d891e477

Branch: refs/heads/master
Commit: d891e47774426e06b92c612fbc58bd098ef8f009
Parents: fdaf9b2
Author: Dejan Bosanac <dejan@nighttale.net>
Authored: Fri May 27 13:51:21 2016 +0200
Committer: Dejan Bosanac <dejan@nighttale.net>
Committed: Fri May 27 13:51:21 2016 +0200

----------------------------------------------------------------------
 .../src/main/resources/features.xml             | 14 +++----
 .../activemq/artemis/osgi/OsgiBroker.java       |  3 +-
 docs/user-manual/en/karaf.md                    | 41 +++++++++++++++++++-
 .../integration/karaf/ArtemisFeatureTest.java   | 33 +++++++++-------
 4 files changed, 68 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/d891e477/artemis-features/src/main/resources/features.xml
----------------------------------------------------------------------
diff --git a/artemis-features/src/main/resources/features.xml b/artemis-features/src/main/resources/features.xml
index 0a88f80..c6cd831 100644
--- a/artemis-features/src/main/resources/features.xml
+++ b/artemis-features/src/main/resources/features.xml
@@ -19,7 +19,7 @@
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.3.0 http://karaf.apache.org/xmlns/features/v1.3.0">
 
-  <feature name="artemis" version="${pom.version}">
+  <feature name="artemis" version="${pom.version}" description="Full ActiveMQ Artemis
broker with default configuration">
     <feature>artemis-core</feature>
     <feature>artemis-amqp</feature>
     <feature>artemis-stomp</feature>
@@ -27,7 +27,7 @@
     <feature>artemis-hornetq</feature>
   </feature>
 
-	<feature name="netty-core" version="${netty.version}">
+	<feature name="netty-core" version="${netty.version}" description="Netty libraries">
 		<bundle>mvn:io.netty/netty-common/${netty.version}</bundle>
 		<bundle>mvn:io.netty/netty-transport/${netty.version}</bundle>
 		<bundle>mvn:io.netty/netty-buffer/${netty.version}</bundle>
@@ -35,7 +35,7 @@
 		<bundle>mvn:io.netty/netty-handler/${netty.version}</bundle>
 	</feature>
 
-	<feature name="artemis-core" version="${pom.version}">
+	<feature name="artemis-core" version="${pom.version}" description="ActiveMQ Artemis broker
libraries">
 		<feature>transaction</feature>
 		<feature>netty-core</feature>
 		<feature>scr</feature>
@@ -55,7 +55,7 @@
 		<bundle>mvn:org.apache.activemq/artemis-server-osgi/${pom.version}</bundle>
 	</feature>
 
-	<feature name="artemis-amqp" version="${pom.version}">
+	<feature name="artemis-amqp" version="${pom.version}" description="ActiveMQ Artemis AMQP
protocol libraries">
 		<feature prerequisite="true">wrap</feature>
 		<feature>artemis-core</feature>
 		<bundle>wrap:mvn:org.apache.qpid/proton-j/${proton.version}</bundle>
@@ -64,17 +64,17 @@
 		<bundle>mvn:org.apache.activemq/artemis-amqp-protocol/${pom.version}</bundle>
 	</feature>
 
-	<feature name="artemis-stomp" version="${pom.version}">
+	<feature name="artemis-stomp" version="${pom.version}" description="ActiveMQ Artemis
Stomp protocol libraries">
 		<feature>artemis-core</feature>
 		<bundle>mvn:org.apache.activemq/artemis-stomp-protocol/${pom.version}</bundle>
 	</feature>
 
-	<feature name="artemis-mqtt" version="${pom.version}">
+	<feature name="artemis-mqtt" version="${pom.version}" description="ActiveMQ Artemis MQTT
protocol libraries">
 		<feature>artemis-core</feature>
 		<bundle>mvn:org.apache.activemq/artemis-mqtt-protocol/${pom.version}</bundle>
 	</feature>
 
-	<feature name="artemis-hornetq" version="${pom.version}">
+	<feature name="artemis-hornetq" version="${pom.version}" description="ActiveMQ Artemis
HornetQ protocol libraries">
 		<feature>artemis-core</feature>
 		<bundle>mvn:org.apache.activemq/artemis-hqclient-protocol/${pom.version}</bundle>
 		<bundle>mvn:org.apache.activemq/artemis-hornetq-protocol/${pom.version}</bundle>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/d891e477/artemis-server-osgi/src/main/java/org/apache/activemq/artemis/osgi/OsgiBroker.java
----------------------------------------------------------------------
diff --git a/artemis-server-osgi/src/main/java/org/apache/activemq/artemis/osgi/OsgiBroker.java
b/artemis-server-osgi/src/main/java/org/apache/activemq/artemis/osgi/OsgiBroker.java
index bfdc73e..d491b17 100644
--- a/artemis-server-osgi/src/main/java/org/apache/activemq/artemis/osgi/OsgiBroker.java
+++ b/artemis-server-osgi/src/main/java/org/apache/activemq/artemis/osgi/OsgiBroker.java
@@ -42,11 +42,12 @@ import org.osgi.framework.ServiceRegistration;
 import org.osgi.service.component.ComponentContext;
 import org.osgi.service.component.annotations.Activate;
 import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.ConfigurationPolicy;
 import org.osgi.service.component.annotations.Deactivate;
 import org.osgi.util.tracker.ServiceTracker;
 
 @SuppressWarnings({"unchecked", "rawtypes"})
-@Component(configurationPid = "org.apache.activemq.artemis")
+@Component(configurationPid = "org.apache.activemq.artemis", configurationPolicy = ConfigurationPolicy.REQUIRE)
 public class OsgiBroker {
    private String name;
    private String configurationUrl;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/d891e477/docs/user-manual/en/karaf.md
----------------------------------------------------------------------
diff --git a/docs/user-manual/en/karaf.md b/docs/user-manual/en/karaf.md
index 2b6e8a6..4756b9b 100644
--- a/docs/user-manual/en/karaf.md
+++ b/docs/user-manual/en/karaf.md
@@ -1,7 +1,44 @@
 # Artemis on Apache Karaf
 
-Apache ActiveMQ Artemis can be installed on Apache Karaf (4.x or later) using the following
commands from the Karaf shell:
+Apache ActiveMQ Artemis is OSGi ready. Below you can find instruction on how to install and
configure broker on Apache Karaf OSGi container.
 
-    feature:repo-add mvn:org.apache.activemq/artemis-features/1.3.0-SNAPSHOT/xml/features
+## Installation
+
+Apache ActiveMQ Artemis provides features that makes it easy to install the broker on Apache
Karaf (4.x or later). First you need to define the feature URL, like 
+
+    karaf@root()> feature:repo-add mvn:org.apache.activemq/artemis-features/1.3.0-SNAPSHOT/xml/features
+    
+This will add Artemis related features   
+    
+	karaf@root()> feature:list | grep artemis
+	artemis                       | 1.3.0.SNAPSHOT   |          | Uninstalled | artemis-1.3.0-SNAPSHOT
  | Full ActiveMQ Artemis broker with default configuration
+	netty-core                    | 4.0.32.Final     |          | Uninstalled | artemis-1.3.0-SNAPSHOT
  | Netty libraries
+	artemis-core                  | 1.3.0.SNAPSHOT   |          | Uninstalled | artemis-1.3.0-SNAPSHOT
  | ActiveMQ Artemis broker libraries
+	artemis-amqp                  | 1.3.0.SNAPSHOT   |          | Uninstalled | artemis-1.3.0-SNAPSHOT
  | ActiveMQ Artemis AMQP protocol libraries
+	artemis-stomp                 | 1.3.0.SNAPSHOT   |          | Uninstalled | artemis-1.3.0-SNAPSHOT
  | ActiveMQ Artemis Stomp protocol libraries
+	artemis-mqtt                  | 1.3.0.SNAPSHOT   |          | Uninstalled | artemis-1.3.0-SNAPSHOT
  | ActiveMQ Artemis MQTT protocol libraries
+	artemis-hornetq               | 1.3.0.SNAPSHOT   |          | Uninstalled | artemis-1.3.0-SNAPSHOT
  | ActiveMQ Artemis HornetQ protocol libraries    
+
+Feature named `artemis` contains full broker installation, so running    
+    
     feature:install artemis
 
+will install and run the broker.
+
+## Configuration
+
+The broker is installed as `org.apache.activemq.artemis` OSGi component, so it's configured
through `${KARAF_BASE}/etc/org.apache.activemq.artemis.cfg` file. An example of the file looks
like
+
+	config=file:etc/artemis.xml
+	name=local
+	domain=karaf
+	rolePrincipalClass=org.apache.karaf.jaas.boot.principal.RolePrincipal
+	
+| Name               | Description                                     | Default value  
                                   |
+| ------------------ | ----------------------------------------------- | --------------------------------------------------
|
+| config             | Location of the configuration file              | ${KARAF_BASE}/etc/artemis.xml
                     |
+| name               | Name of the broker                              | local          
                                   |
+| domain             | JAAS domain to use for security                 | karaf          
                                   |
+| rolePrincipalClass | Class name used for role authorization purposes | org.apache.karaf.jaas.boot.principal.RolePrincipal
|
+	
+The default broker configuration file is located in `${KARAF_BASE}/etc/artemis.xml`	
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/d891e477/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/ArtemisFeatureTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/ArtemisFeatureTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/ArtemisFeatureTest.java
index b216110..134dd9a 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/ArtemisFeatureTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/ArtemisFeatureTest.java
@@ -140,19 +140,26 @@ public class ArtemisFeatureTest extends Assert {
 
       executeCommand("service:list -n");
 
-      String amqpURI = "amqp://localhost:5672";
-      JmsConnectionFactory factory = new JmsConnectionFactory(amqpURI);
-      Connection connection = factory.createConnection(USER, PASSWORD);
-      connection.start();
-
-      javax.jms.Session sess = connection.createSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);
-      Queue queue = sess.createQueue("jms.queue.exampleQueue");
-      MessageProducer producer = sess.createProducer(queue);
-      producer.send(sess.createTextMessage("TEST"));
-
-      MessageConsumer consumer = sess.createConsumer(queue);
-      Message msg = consumer.receive(5000);
-      assertNotNull(msg);
+      Connection connection = null;
+      try {
+         JmsConnectionFactory factory = new JmsConnectionFactory("amqp://localhost:5672");
+         connection = factory.createConnection(USER, PASSWORD);
+         connection.start();
+
+         javax.jms.Session sess = connection.createSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);
+         Queue queue = sess.createQueue("jms.queue.exampleQueue");
+         MessageProducer producer = sess.createProducer(queue);
+         producer.send(sess.createTextMessage("TEST"));
+
+         MessageConsumer consumer = sess.createConsumer(queue);
+         Message msg = consumer.receive(5000);
+         assertNotNull(msg);
+      }
+      finally {
+         if (connection != null) {
+            connection.close();
+         }
+      }
    }
 
    protected String executeCommand(final String command, final Long timeout, final Boolean
silent) {


Mime
View raw message