Skip to content

Commit

Permalink
ACS-5449 Revert 2 commits
Browse files Browse the repository at this point in the history
  • Loading branch information
Oskar Rajzner committed Jul 20, 2023
1 parent 96332f4 commit 59111fc
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">

<routeContext id="deadLetterRoutes" xmlns="http://camel.apache.org/schema/spring">
<route id="alfresco.default.deadLetter">
<from uri="direct-vm:alfresco.default" />
<to uri="bean:deadLetterQueue" />
</route>
</routeContext>

</beans>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#Node events
messaging.events.repo.node.sourceQueue.endpoint=direct-vm:alfresco.events
messaging.events.repo.node.targetTopic.endpoint=amqp:topic:alfresco.repo.events.nodes?jmsMessageType=Text

messaging.routing.numThreads=10
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:task="http://www.springframework.org/schema/task"
xmlns:camel="http://camel.apache.org/schema/spring"
xsi:schemaLocation="http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">

<context:component-scan base-package="org.alfresco.messaging.camel.configuration"/>

<bean id="messagingObjectMapper" class="org.gytheio.messaging.jackson.ObjectMapperFactory"
factory-method="createInstance" />

<bean id="defaultDataFormat" class="org.apache.camel.component.jackson.JacksonDataFormat">
<constructor-arg ref="messagingObjectMapper" />
<constructor-arg value="java.lang.Object" />
</bean>

<bean id="pooledConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory"
init-method="start" destroy-method="stop">
<property name="maxConnections" value="${messaging.broker.connections.max}" />
<property name="createConnectionOnStartup" value="false"/>
<property name="connectionFactory" ref="activeMqConnectionFactory" />
</bean>

<bean id="messagingTransactionManager" class="org.springframework.jms.connection.JmsTransactionManager">
<property name="connectionFactory" ref="pooledConnectionFactory"/>
</bean>

<bean id="jmsConfig" class="org.apache.camel.component.jms.JmsConfiguration">
<property name="connectionFactory" ref="pooledConnectionFactory" />
<property name="transacted" value="${messaging.transacted}" />
<property name="transactionManager" ref="messagingTransactionManager" />
</bean>

<bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
<property name="configuration" ref="jmsConfig"/>
</bean>

<bean id="activemq" class="org.apache.camel.component.activemq.ActiveMQComponent">
<property name="configuration" ref="jmsConfig"/>
</bean>

<bean id="amqp" class="org.apache.camel.component.amqp.AMQPComponent">
<property name="configuration" ref="jmsConfig"/>
</bean>

<bean id="CAMEL_PROPAGATION_MANDATORY" class="org.apache.camel.spring.spi.SpringTransactionPolicy">
<property name="transactionManager" ref="messagingTransactionManager" />
<property name="propagationBehaviorName" value="PROPAGATION_MANDATORY" />
</bean>

<bean id="CAMEL_PROPAGATION_NEVER" class="org.apache.camel.spring.spi.SpringTransactionPolicy">
<property name="transactionManager" ref="messagingTransactionManager" />
<property name="propagationBehaviorName" value="PROPAGATION_NEVER" />
</bean>

<bean id="CAMEL_PROPAGATION_NOT_SUPPORTED" class="org.apache.camel.spring.spi.SpringTransactionPolicy">
<property name="transactionManager" ref="messagingTransactionManager" />
<property name="propagationBehaviorName" value="PROPAGATION_NOT_SUPPORTED" />
</bean>

<bean id="CAMEL_PROPAGATION_REQUIRED" class="org.apache.camel.spring.spi.SpringTransactionPolicy">
<property name="transactionManager" ref="messagingTransactionManager" />
<property name="propagationBehaviorName" value="PROPAGATION_REQUIRED" />
</bean>

<bean id="CAMEL_PROPAGATION_REQUIRES_NEW" class="org.apache.camel.spring.spi.SpringTransactionPolicy">
<property name="transactionManager" ref="messagingTransactionManager" />
<property name="propagationBehaviorName" value="PROPAGATION_REQUIRES_NEW" />
</bean>

<bean id="CAMEL_PROPAGATION_SUPPORTS" class="org.apache.camel.spring.spi.SpringTransactionPolicy">
<property name="transactionManager" ref="messagingTransactionManager" />
<property name="propagationBehaviorName" value="PROPAGATION_SUPPORTS" />
</bean>

<!-- Any RouteBuilder in this package will be fired up -->
<context:component-scan base-package="org.alfresco.messaging.camel.routes"/>

<!-- Any RouteBuilder in this enterprise package will be fired up -->
<context:component-scan base-package="org.alfresco.enterprise.repo.routes"/>

<camelContext id="alfrescoCamelContext" xmlns="http://camel.apache.org/schema/spring" useBreadcrumb="true">
<contextScan/>
<jmxAgent id="agent" />
<template id="camelProducerTemplate" defaultEndpoint="direct:alfresco.default" />
</camelContext>

<import resource="defaultRoutes.xml" />
<bean id="defaultRouteLoader" class="org.alfresco.messaging.camel.SpringContextRouteLoader">
<property name="camelContextId" value="alfrescoCamelContext" />
<property name="routeContextId" value="deadLetterRoutes" />
</bean>

<!-- In the default routes, this is where a message goes if no queue is specified -->
<bean id="deadLetterQueue" class="org.gytheio.messaging.LoggingDeadLetterQueue" />

</beans>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# External failover broker at nio://localhost ("nio" = "tcp" through the java.nio API)
messaging.broker.url=failover:(nio://localhost:61616)?timeout=3000&jms.useCompression=true
messaging.broker.ssl=false
messaging.broker.username=
messaging.broker.password=
messaging.broker.connections.max=8
messaging.camel.context.id=alfrescoCamelContext
messaging.transacted=true
#messaging.routes.id=amqpRoutes

0 comments on commit 59111fc

Please sign in to comment.