Skip to content

Commit

Permalink
CAMEL-20600: camel-activemq6 for using 6.x brokers
Browse files Browse the repository at this point in the history
  • Loading branch information
davsclaus committed May 18, 2024
1 parent d3a860c commit f51f7ef
Show file tree
Hide file tree
Showing 16 changed files with 3,204 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

activemq
activemq6
amqp
arangodb
as2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"component": {
"kind": "component",
"name": "activemq",
"title": "ActiveMQ",
"description": "Send messages to (or consume from) Apache ActiveMQ. This component extends the Camel JMS component.",
"title": "ActiveMQ 5.x",
"description": "Send messages to (or consume from) Apache ActiveMQ 5.x. This component extends the Camel JMS component.",
"deprecated": false,
"firstVersion": "1.0.0",
"label": "messaging",
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion components-starter/camel-activemq-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</parent>
<artifactId>camel-activemq-starter</artifactId>
<packaging>jar</packaging>
<name>Camel SB Starters :: ActiveMQ</name>
<name>Camel SB Starters :: ActiveMQ 5.x</name>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
import org.springframework.util.ErrorHandler;

/**
* Send messages to (or consume from) Apache ActiveMQ. This component extends
* the Camel JMS component.
* Send messages to (or consume from) Apache ActiveMQ 5.x. This component
* extends the Camel JMS component.
*
* Generated by camel-package-maven-plugin - do not edit this file!
*/
Expand Down
48 changes: 48 additions & 0 deletions components-starter/camel-activemq6-starter/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>components-starter</artifactId>
<version>4.7.0-SNAPSHOT</version>
</parent>
<artifactId>camel-activemq6-starter</artifactId>
<packaging>jar</packaging>
<name>Camel SB Starters :: ActiveMQ 6.x</name>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>${spring-boot-version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-activemq6</artifactId>
<version>${camel-version}</version>
</dependency>
<!--START OF GENERATED CODE-->
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-core-starter</artifactId>
</dependency>
<!--END OF GENERATED CODE-->
</dependencies>
</project>

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.camel.component.activemq6.springboot;

import org.apache.camel.CamelContext;
import org.apache.camel.Component;
import org.apache.camel.component.activemq6.ActiveMQComponent;
import org.apache.camel.spi.ComponentCustomizer;
import org.apache.camel.spring.boot.CamelAutoConfiguration;
import org.apache.camel.spring.boot.ComponentConfigurationProperties;
import org.apache.camel.spring.boot.util.CamelPropertiesHelper;
import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans;
import org.apache.camel.spring.boot.util.ConditionalOnHierarchicalProperties;
import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;

/**
* Generated by camel-package-maven-plugin - do not edit this file!
*/
@Configuration(proxyBeanMethods = false)
@Conditional(ConditionalOnCamelContextAndAutoConfigurationBeans.class)
@EnableConfigurationProperties({ComponentConfigurationProperties.class,ActiveMQComponentConfiguration.class})
@ConditionalOnHierarchicalProperties({"camel.component", "camel.component.activemq6"})
@AutoConfigureAfter({CamelAutoConfiguration.class, ActiveMQComponentConverter.class})
public class ActiveMQComponentAutoConfiguration {

@Autowired
private ApplicationContext applicationContext;
private final CamelContext camelContext;
@Autowired
private ActiveMQComponentConfiguration configuration;

public ActiveMQComponentAutoConfiguration(
org.apache.camel.CamelContext camelContext) {
this.camelContext = camelContext;
}

@Lazy
@Bean
public ComponentCustomizer configureActiveMQComponent() {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
CamelPropertiesHelper.copyProperties(camelContext, configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
return HierarchicalPropertiesEvaluator.evaluate(
applicationContext,
"camel.component.customizer",
"camel.component.activemq6.customizer")
&& target instanceof ActiveMQComponent;
}
};
}
}
Loading

0 comments on commit f51f7ef

Please sign in to comment.