mirror of https://github.com/apache/activemq.git
AMQ-5657: Upgrade to Camel 2.15.0
This commit is contained in:
parent
185213b44a
commit
6097401c50
|
@ -32,7 +32,7 @@
|
|||
|
||||
<properties>
|
||||
<activemq.osgi.import.pkg>
|
||||
org.springframework.jms*;version="[3,4)",
|
||||
org.springframework.jms*;version="[3,5)",
|
||||
org.apache.activemq.pool,
|
||||
org.apache.camel*;version="${camel-version-range}",
|
||||
*
|
||||
|
@ -40,6 +40,10 @@
|
|||
<activemq.osgi.export>
|
||||
org.apache.activemq.camel*;version:="${project.version}";-noimport:=true
|
||||
</activemq.osgi.export>
|
||||
<camel.osgi.export.service>
|
||||
org.apache.camel.spi.ComponentResolver;component=activemq,
|
||||
org.apache.camel.spi.ComponentResolver;component=broker
|
||||
</camel.osgi.export.service>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
|
|
@ -63,7 +63,7 @@ public class BrokerComponent extends UriEndpointComponent implements EndpointCom
|
|||
}
|
||||
|
||||
ActiveMQDestination destination = ActiveMQDestination.createDestination(remaining, destinationType);
|
||||
BrokerEndpoint brokerEndpoint = new BrokerEndpoint(uri, this, destination, brokerConfiguration);
|
||||
BrokerEndpoint brokerEndpoint = new BrokerEndpoint(uri, this, remaining, destination, brokerConfiguration);
|
||||
setProperties(brokerEndpoint, parameters);
|
||||
return brokerEndpoint;
|
||||
}
|
||||
|
|
|
@ -17,7 +17,9 @@
|
|||
package org.apache.activemq.camel.component.broker;
|
||||
|
||||
import org.apache.camel.spi.UriParam;
|
||||
import org.apache.camel.spi.UriParams;
|
||||
|
||||
@UriParams
|
||||
public class BrokerConfiguration {
|
||||
|
||||
@UriParam
|
||||
|
@ -27,6 +29,9 @@ public class BrokerConfiguration {
|
|||
return brokerName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of the broker
|
||||
*/
|
||||
public void setBrokerName(String brokerName) {
|
||||
this.brokerName = brokerName;
|
||||
}
|
||||
|
|
|
@ -31,26 +31,30 @@ import org.apache.camel.Producer;
|
|||
import org.apache.camel.Service;
|
||||
import org.apache.camel.api.management.ManagedResource;
|
||||
import org.apache.camel.impl.DefaultEndpoint;
|
||||
import org.apache.camel.spi.Metadata;
|
||||
import org.apache.camel.spi.UriEndpoint;
|
||||
import org.apache.camel.spi.UriParam;
|
||||
import org.apache.camel.spi.UriPath;
|
||||
import org.apache.camel.util.UnsafeUriCharactersEncoder;
|
||||
|
||||
@ManagedResource(description = "Managed Camel Broker Endpoint")
|
||||
@UriEndpoint(scheme = "broker", consumerClass = BrokerConsumer.class)
|
||||
@UriEndpoint(scheme = "broker", consumerClass = BrokerConsumer.class, syntax = "broker:destination", label = "messaging")
|
||||
public class BrokerEndpoint extends DefaultEndpoint implements MultipleConsumersSupport, Service {
|
||||
|
||||
static final String PRODUCER_BROKER_EXCHANGE = "producerBrokerExchange";
|
||||
|
||||
@UriParam
|
||||
private final BrokerConfiguration configuration;
|
||||
private MessageInterceptorRegistry messageInterceptorRegistry;
|
||||
@UriPath
|
||||
private final ActiveMQDestination destination;
|
||||
private List<MessageInterceptor> messageInterceptorList = new CopyOnWriteArrayList<MessageInterceptor>();
|
||||
|
||||
public BrokerEndpoint(String uri, BrokerComponent component, ActiveMQDestination destination, BrokerConfiguration configuration) {
|
||||
@UriPath(name = "destination") @Metadata(required = "true")
|
||||
private String destinationName;
|
||||
private final ActiveMQDestination destination;
|
||||
@UriParam
|
||||
private final BrokerConfiguration configuration;
|
||||
|
||||
public BrokerEndpoint(String uri, BrokerComponent component, String destinationName, ActiveMQDestination destination, BrokerConfiguration configuration) {
|
||||
super(UnsafeUriCharactersEncoder.encode(uri), component);
|
||||
this.destinationName = destinationName;
|
||||
this.destination = destination;
|
||||
this.configuration = configuration;
|
||||
}
|
||||
|
@ -82,10 +86,17 @@ public class BrokerEndpoint extends DefaultEndpoint implements MultipleConsumers
|
|||
return destination;
|
||||
}
|
||||
|
||||
/**
|
||||
* The name of the JMS destination
|
||||
*/
|
||||
public String getDestinationName() {
|
||||
return destinationName;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doStart() throws Exception {
|
||||
super.doStart();
|
||||
messageInterceptorRegistry = MessageInterceptorRegistry.getInstance().get(configuration.getBrokerName());
|
||||
messageInterceptorRegistry = MessageInterceptorRegistry.getInstance().get(configuration.getBrokerName());
|
||||
for (MessageInterceptor messageInterceptor : messageInterceptorList) {
|
||||
addMessageInterceptor(messageInterceptor);
|
||||
}
|
||||
|
|
4
pom.xml
4
pom.xml
|
@ -47,8 +47,8 @@
|
|||
<aries-version>1.1.0</aries-version>
|
||||
<aries-transaction-version>1.1.1</aries-transaction-version>
|
||||
<axion-version>1.0-M3-dev</axion-version>
|
||||
<camel-version>2.14.1</camel-version>
|
||||
<camel-version-range>[2.14,3)</camel-version-range>
|
||||
<camel-version>2.15.0</camel-version>
|
||||
<camel-version-range>[2.15,3)</camel-version-range>
|
||||
<cglib-version>2.2</cglib-version>
|
||||
<commons-beanutils-version>1.8.3</commons-beanutils-version>
|
||||
<commons-collections-version>3.2.1</commons-collections-version>
|
||||
|
|
Loading…
Reference in New Issue