CAMEL-16889: camel-jms - Artemis streaming mode should be supported on producer when using pooled CF.
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 @@
$ 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">