You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by kl...@apache.org on 2022/11/09 22:53:06 UTC
[camel-karaf-examples] branch CAMEL-18664 updated: Fix artemis-amqp-blueprint example integration test. Use EmbeddedActiveMQ and upgrade spring configuration.
This is an automated email from the ASF dual-hosted git repository.
klease pushed a commit to branch CAMEL-18664
in repository https://gitbox.apache.org/repos/asf/camel-karaf-examples.git
The following commit(s) were added to refs/heads/CAMEL-18664 by this push:
new 7af88a1 Fix artemis-amqp-blueprint example integration test. Use EmbeddedActiveMQ and upgrade spring configuration.
7af88a1 is described below
commit 7af88a14d741ff3adcb6c3538de9dc66de55c61f
Author: klease <kl...@cegetel.net>
AuthorDate: Wed Nov 9 23:49:45 2022 +0100
Fix artemis-amqp-blueprint example integration test.
Use EmbeddedActiveMQ and upgrade spring configuration.
---
.../example/artemis/amqp/EmbeddedBrokerSupport.java | 18 +++++-------------
.../resources/OSGI-INF/blueprint/embedded-broker.xml | 2 ++
.../src/test/resources/broker.xml | 3 ++-
3 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/examples/camel-example-artemis-amqp-blueprint/src/test/java/org/apache/camel/example/artemis/amqp/EmbeddedBrokerSupport.java b/examples/camel-example-artemis-amqp-blueprint/src/test/java/org/apache/camel/example/artemis/amqp/EmbeddedBrokerSupport.java
index 2313810..64b4907 100644
--- a/examples/camel-example-artemis-amqp-blueprint/src/test/java/org/apache/camel/example/artemis/amqp/EmbeddedBrokerSupport.java
+++ b/examples/camel-example-artemis-amqp-blueprint/src/test/java/org/apache/camel/example/artemis/amqp/EmbeddedBrokerSupport.java
@@ -16,30 +16,22 @@
*/
package org.apache.camel.example.artemis.amqp;
-import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS;
+import org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ;
import org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager;
-// import org.apache.activemq.artemis.core.config.impl.SecurityConfiguration;
-// import org.apache.activemq.artemis.spi.core.security.jaas.InVMLoginModule;
-
//#################################################
// Blueprint does not support Bean inheritance (necessary for Artemis EmbeddedJMS)
// We need therefore a 'support' class
//#################################################
-public class EmbeddedBrokerSupport extends EmbeddedJMS {
+public class EmbeddedBrokerSupport extends EmbeddedActiveMQ {
public EmbeddedBrokerSupport(ActiveMQJAASSecurityManager securityManager) throws Exception {
this.setSecurityManager(securityManager);
+ }
+
+ public void startServer() throws Exception {
this.start();
-
- //if you need more twicking use Java to customise as follows:
- // SecurityConfiguration securityConfig = new SecurityConfiguration();
- // securityConfig.addUser("guest", "guest");
- // securityConfig.addRole("guest", "guest");
- // securityConfig.setDefaultUser("guest");
- // ActiveMQJAASSecurityManager securityManager = new ActiveMQJAASSecurityManager(InVMLoginModule.class.getName(), securityConfig);
- // this.setSecurityManager(securityManager);
}
public void close() throws Exception {
diff --git a/examples/camel-example-artemis-amqp-blueprint/src/test/resources/OSGI-INF/blueprint/embedded-broker.xml b/examples/camel-example-artemis-amqp-blueprint/src/test/resources/OSGI-INF/blueprint/embedded-broker.xml
index 0cc179e..9aad1c5 100644
--- a/examples/camel-example-artemis-amqp-blueprint/src/test/resources/OSGI-INF/blueprint/embedded-broker.xml
+++ b/examples/camel-example-artemis-amqp-blueprint/src/test/resources/OSGI-INF/blueprint/embedded-broker.xml
@@ -50,10 +50,12 @@
</argument>
</bean>
+
<!-- Blueprint does not support Bean inheritance (necessary for Artemis EmbeddedJMS)
We need therefore a 'support' class -->
<bean id="embeddedJMS"
class="org.apache.camel.example.artemis.amqp.EmbeddedBrokerSupport"
+ init-method="startServer"
destroy-method="close">
<argument ref="securityManager"/>
</bean>
diff --git a/examples/camel-example-artemis-amqp-blueprint/src/test/resources/broker.xml b/examples/camel-example-artemis-amqp-blueprint/src/test/resources/broker.xml
index 746eaf3..f3319ab 100644
--- a/examples/camel-example-artemis-amqp-blueprint/src/test/resources/broker.xml
+++ b/examples/camel-example-artemis-amqp-blueprint/src/test/resources/broker.xml
@@ -39,10 +39,11 @@
<permission type="deleteDurableQueue" roles="guest"/>
<permission type="createNonDurableQueue" roles="guest"/>
<permission type="deleteNonDurableQueue" roles="guest"/>
+ <permission type="createAddress" roles="guest"/>
<permission type="consume" roles="guest"/>
<permission type="send" roles="guest"/>
</security-setting>
</security-settings>
</core>
-</configuration>
\ No newline at end of file
+</configuration>