This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-examples.git


The following commit(s) were added to refs/heads/main by this push:
     new 8c58101  CAMEL-16889: camel-jms - Artemis streaming mode should be 
supported on producer when using pooled CF.
8c58101 is described below

commit 8c58101091ef48f50a649e540032f9a7fbf35a56
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Wed Aug 25 16:54:12 2021 +0200

    CAMEL-16889: camel-jms - Artemis streaming mode should be supported on 
producer when using pooled CF.
---
 examples/artemis-large-messages/README.adoc                |  4 ++--
 examples/artemis-large-messages/pom.xml                    |  6 ++++++
 .../src/main/resources/META-INF/spring/camel-context.xml   | 14 +++++++++++++-
 3 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/examples/artemis-large-messages/README.adoc 
b/examples/artemis-large-messages/README.adoc
index d51f144..6ea89de 100644
--- a/examples/artemis-large-messages/README.adoc
+++ b/examples/artemis-large-messages/README.adoc
@@ -3,7 +3,7 @@
 === Introduction
 
 This example shows how to send large messages between Apache Camel and
-ActiveMQ Artemis. When we say large messages we refer to messages with
+ActiveMQ Artemis. For large messages we refer to messages with
 sizes of GB.
 
 You should be able to run Camel and Artemis in JVMs with lower memory
@@ -66,7 +66,7 @@ And then start the Camel application:
 $ mvn camel:run
 ----
 
-You can then copy files to `target/inbox` folder which is send to
+You can then copy files to `target/inbox` folder which is sent to
 Artemis, and then back again to Camel and written to the
 `target/outbox` folder.
 
diff --git a/examples/artemis-large-messages/pom.xml 
b/examples/artemis-large-messages/pom.xml
index 902268d..b0f1a40 100644
--- a/examples/artemis-large-messages/pom.xml
+++ b/examples/artemis-large-messages/pom.xml
@@ -81,6 +81,12 @@
             <artifactId>geronimo-jms_2.0_spec</artifactId>
             <version>${geronimo-jms2-spec-version}</version>
         </dependency>
+        <!-- pooled connection -->
+        <dependency>
+            <groupId>org.messaginghub</groupId>
+            <artifactId>pooled-jms</artifactId>
+            <version>2.0.1</version>
+        </dependency>
 
         <!-- logging -->
         <dependency>
diff --git 
a/examples/artemis-large-messages/src/main/resources/META-INF/spring/camel-context.xml
 
b/examples/artemis-large-messages/src/main/resources/META-INF/spring/camel-context.xml
index aa906da..e692098 100644
--- 
a/examples/artemis-large-messages/src/main/resources/META-INF/spring/camel-context.xml
+++ 
b/examples/artemis-large-messages/src/main/resources/META-INF/spring/camel-context.xml
@@ -26,11 +26,23 @@
   <!-- setup ActiveMQ Artemis connection factory -->
   <bean id="artemisConnectionFactory" 
class="org.apache.activemq.artemis.jms.client.ActiveMQJMSConnectionFactory">
     <constructor-arg index="0" value="tcp://localhost:61616"/>
+    <!-- setup for allowing to compress large messages with Artemis -->
+    <property name="minLargeMessageSize" value="10240"/>
+    <property name="compressLargeMessage" value="true"/>
+  </bean>
+
+  <!-- use pooled connection factory -->
+  <bean id="pooledCF" 
class="org.messaginghub.pooled.jms.JmsPoolConnectionFactory">
+    <property name="connectionFactory" ref="artemisConnectionFactory"/>
+    <property name="maxConnections" value="1"/>
+    <property name="maxSessionsPerConnection" value="10"/>
   </bean>
 
   <bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
     <!-- specify connection factory on JMS component -->
-    <property name="connectionFactory" ref="artemisConnectionFactory"/>
+    <property name="connectionFactory" ref="pooledCF"/>
+    <!-- turn on support for using Artemis streaming mode -->
+    <property name="artemisStreamingEnabled" value="true"/>
   </bean>
 
   <camelContext id="myCamel" xmlns="http://camel.apache.org/schema/spring";>

Reply via email to