AMQ-9281: Add Camel 4.1.0 and exclude OSGi/Karaf for now

This commit is contained in:
Jean-Baptiste Onofré 2023-10-24 07:58:59 +02:00 committed by JB Onofré
parent a6631734f9
commit f44c46ca05
11 changed files with 104 additions and 81 deletions

View File

@ -111,14 +111,6 @@
<version>${qpid-jms-version}</version> <version>${qpid-jms-version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.apache.camel.karaf</groupId>
<artifactId>apache-camel</artifactId>
<version>${camel-version}</version>
<type>xml</type>
<classifier>features</classifier>
<scope>test</scope>
</dependency>
<!-- test and logging --> <!-- test and logging -->
<dependency> <dependency>

View File

@ -145,8 +145,6 @@ public abstract class AbstractFeatureTest {
String karafVersion = MavenUtils.getArtifactVersion("org.apache.karaf", "apache-karaf"); String karafVersion = MavenUtils.getArtifactVersion("org.apache.karaf", "apache-karaf");
MavenUrlReference karafUrl = maven().groupId("org.apache.karaf").artifactId("apache-karaf") MavenUrlReference karafUrl = maven().groupId("org.apache.karaf").artifactId("apache-karaf")
.type("tar.gz").versionAsInProject(); .type("tar.gz").versionAsInProject();
UrlReference camelUrl = maven().groupId("org.apache.camel.karaf")
.artifactId("apache-camel").type("xml").classifier("features").versionAsInProject();
UrlReference activeMQUrl = maven().groupId("org.apache.activemq"). UrlReference activeMQUrl = maven().groupId("org.apache.activemq").
artifactId("activemq-karaf").versionAsInProject().type("xml").classifier("features").versionAsInProject(); artifactId("activemq-karaf").versionAsInProject().type("xml").classifier("features").versionAsInProject();
return composite( return composite(
@ -157,15 +155,10 @@ public abstract class AbstractFeatureTest {
editConfigurationFilePut("etc/org.ops4j.pax.url.mvn.cfg", "org.ops4j.pax.url.mvn.repositories", "https://repo1.maven.org/maven2@id=central"), editConfigurationFilePut("etc/org.ops4j.pax.url.mvn.cfg", "org.ops4j.pax.url.mvn.repositories", "https://repo1.maven.org/maven2@id=central"),
editConfigurationFilePut("etc/config.properties", "karaf.startlevel.bundle", "50"), editConfigurationFilePut("etc/config.properties", "karaf.startlevel.bundle", "50"),
// debugConfiguration("5005", true), // debugConfiguration("5005", true),
features(activeMQUrl, features), // features(activeMQUrl, features)
features(camelUrl)
); );
} }
protected static String camelVersion() {
return MavenUtils.getArtifactVersion("org.apache.camel.karaf", "apache-camel");
}
public static boolean withinReason(Callable<Boolean> callable) throws Exception { public static boolean withinReason(Callable<Boolean> callable) throws Exception {
long max = System.currentTimeMillis() + ASSERTION_TIMEOUT; long max = System.currentTimeMillis() + ASSERTION_TIMEOUT;
while (true) { while (true) {

View File

@ -39,7 +39,6 @@ public class ActiveMQBrokerNdCamelFeatureTest extends AbstractFeatureTest {
return new Option[] // return new Option[] //
{ {
composite(configure("activemq", "activemq-shell", "camel-jms")), composite(configure("activemq", "activemq-shell", "camel-jms")),
editConfigurationFilePut("etc/system.properties", "camel.version", camelVersion()),
replaceConfigurationFile("etc/activemq.xml", new File(RESOURCE_BASE + "activemq-nd-camel.xml")), replaceConfigurationFile("etc/activemq.xml", new File(RESOURCE_BASE + "activemq-nd-camel.xml")),
replaceConfigurationFile("etc/org.apache.activemq.server-default.cfg", new File(RESOURCE_BASE + "org.apache.activemq.server-default.cfg")) replaceConfigurationFile("etc/org.apache.activemq.server-default.cfg", new File(RESOURCE_BASE + "org.apache.activemq.server-default.cfg"))
}; };

View File

@ -40,8 +40,7 @@ public class ActiveMQBrokerNdExternalCamelFeatureTest extends AbstractFeatureTes
{ {
configure("activemq"), configure("activemq"),
// copy camel.xml into a temporary directory in karaf, so we later can hot-deploy it // copy camel.xml into a temporary directory in karaf, so we later can hot-deploy it
replaceConfigurationFile("data/tmp/camel.xml", new File(RESOURCE_BASE + "camel.xml")), replaceConfigurationFile("data/tmp/camel.xml", new File(RESOURCE_BASE + "camel.xml"))
editConfigurationFilePut("etc/system.properties", "camel.version", camelVersion())
}; };
} }

View File

@ -42,14 +42,6 @@
<bundle>mvn:org.apache.activemq/activemq-karaf/${project.version}</bundle> <bundle>mvn:org.apache.activemq/activemq-karaf/${project.version}</bundle>
</feature> </feature>
<feature name="activemq-camel" version="${project.version}">
<feature version="${project.version}">activemq-client</feature>
<feature version="${camel-version-range}">camel-jms</feature>
<feature version="${camel-version-range}">camel</feature>
<feature version="${camel-version-range}">camel-spring</feature>
<feature version="${camel-version-range}">camel-blueprint</feature>
</feature>
<!-- <!--
Don't forget to bind Karaf JMX server to 0.0.0.0 to have a functional webconsole: Don't forget to bind Karaf JMX server to 0.0.0.0 to have a functional webconsole:
In etc/org.apache.karaf.management.cfg, both rmiRegistryHost and rmiServerHost should use 0.0.0.0 In etc/org.apache.karaf.management.cfg, both rmiRegistryHost and rmiServerHost should use 0.0.0.0

View File

@ -94,11 +94,6 @@
<groupId>${project.groupId}</groupId> <groupId>${project.groupId}</groupId>
<artifactId>activemq-spring</artifactId> <artifactId>activemq-spring</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-blueprint</artifactId>
</dependency>
<dependency> <dependency>
<groupId>${project.groupId}</groupId> <groupId>${project.groupId}</groupId>
@ -255,15 +250,6 @@
<outputDirectory>${basedir}/target/extra-resources/</outputDirectory> <outputDirectory>${basedir}/target/extra-resources/</outputDirectory>
<includes>camel-spring.xsd</includes> <includes>camel-spring.xsd</includes>
</artifactItem> </artifactItem>
<artifactItem>
<groupId>org.apache.camel</groupId>
<artifactId>camel-blueprint</artifactId>
<version>${camel-version}</version>
<type>jar</type>
<overWrite>false</overWrite>
<outputDirectory>${basedir}/target/extra-resources/</outputDirectory>
<includes>camel-blueprint.xsd</includes>
</artifactItem>
</artifactItems> </artifactItems>
</configuration> </configuration>
</execution> </execution>

View File

@ -26,7 +26,6 @@ import java.util.Properties;
import org.apache.activemq.broker.BrokerService; import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.spring.SpringBrokerContext; import org.apache.activemq.spring.SpringBrokerContext;
import org.apache.activemq.spring.Utils; import org.apache.activemq.spring.Utils;
import org.apache.camel.blueprint.CamelContextFactoryBean;
import org.osgi.framework.BundleContext; import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration; import org.osgi.framework.ServiceRegistration;
import org.osgi.service.cm.ConfigurationException; import org.osgi.service.cm.ConfigurationException;
@ -93,9 +92,10 @@ public class ActiveMQServiceFactory implements ManagedServiceFactory {
@Override @Override
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
if (bean instanceof CamelContextFactoryBean) { // camel-blueprint is not provided by camel 4.1.0
((CamelContextFactoryBean) bean).setBundleContext(bundleContext); //if (bean instanceof CamelContextFactoryBean) {
} // ((CamelContextFactoryBean) bean).setBundleContext(bundleContext);
//}
return bean; return bean;
} }

View File

@ -162,18 +162,90 @@
</dependency> </dependency>
<!-- camel --> <!-- camel -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-activemq</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-base</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-base-engine</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.apache.camel</groupId> <groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId> <artifactId>camel-core</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core-catalog</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core-engine</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core-languages</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core-model</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core-processor</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core-reifier</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core-xml</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-log</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-management-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-util</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.apache.camel</groupId> <groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId> <artifactId>camel-spring</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring-xml</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-support</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-timer</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.apache.camel</groupId> <groupId>org.apache.camel</groupId>
<artifactId>camel-jms</artifactId> <artifactId>camel-jms</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-xml-jaxb</artifactId>
</dependency>
<!-- commons --> <!-- commons -->
<dependency> <dependency>

View File

@ -145,7 +145,7 @@
<include>jakarta.transaction:jakarta.transaction-api</include> <include>jakarta.transaction:jakarta.transaction-api</include>
<include>${pom.groupId}:activemq-web</include> <include>${pom.groupId}:activemq-web</include>
<include>org.fusesource.hawtbuf:hawtbuf</include> <include>org.fusesource.hawtbuf:hawtbuf</include>
<include>jakarta.xml.bind:jaxb-api</include> <include>jakarta.xml.bind:jakarta.xml.bind-api</include>
<include>org.glassfish.jaxb:jaxb-runtime</include> <include>org.glassfish.jaxb:jaxb-runtime</include>
<include>org.glassfish.jaxb:jaxb-core</include> <include>org.glassfish.jaxb:jaxb-core</include>
<include>com.sun.istack:istack-commons-runtime</include> <include>com.sun.istack:istack-commons-runtime</include>
@ -157,20 +157,36 @@
<fileMode>0644</fileMode> <fileMode>0644</fileMode>
<directoryMode>0755</directoryMode> <directoryMode>0755</directoryMode>
</dependencySet> </dependencySet>
<!-- AMQ-9239 as of 2023-06-05 Camel does not support jakarta.jms*
<dependencySet> <dependencySet>
<outputDirectory>lib/camel</outputDirectory> <outputDirectory>lib/camel</outputDirectory>
<unpack>false</unpack> <unpack>false</unpack>
<scope>runtime</scope> <scope>runtime</scope>
<includes> <includes>
<include>org.apache.camel:camel-activemq</include>
<include>org.apache.camel:camel-api</include>
<include>org.apache.camel:camel-base</include>
<include>org.apache.camel:camel-base-engine</include>
<include>org.apache.camel:camel-core</include> <include>org.apache.camel:camel-core</include>
<include>org.apache.camel:camel-core-catalog</include>
<include>org.apache.camel:camel-core-engine</include>
<include>org.apache.camel:camel-core-languages</include>
<include>org.apache.camel:camel-core-model</include>
<include>org.apache.camel:camel-core-processor</include>
<include>org.apache.camel:camel-core-reifier</include>
<include>org.apache.camel:camel-core-xml</include>
<include>org.apache.camel:camel-log</include>
<include>org.apache.camel:camel-management-api</include>
<include>org.apache.camel:camel-spring</include> <include>org.apache.camel:camel-spring</include>
<include>org.apache.camel:camel-spring-xml</include>
<include>org.apache.camel:camel-support</include>
<include>org.apache.camel:camel-timer</include>
<include>org.apache.camel:camel-util</include>
<include>org.apache.camel:camel-jms</include> <include>org.apache.camel:camel-jms</include>
<include>org.apache.camel:camel-xml-jaxb</include>
</includes> </includes>
<fileMode>0644</fileMode> <fileMode>0644</fileMode>
<directoryMode>0755</directoryMode> <directoryMode>0755</directoryMode>
</dependencySet> </dependencySet>
-->
<dependencySet> <dependencySet>
<outputDirectory>lib/optional</outputDirectory> <outputDirectory>lib/optional</outputDirectory>
<unpack>false</unpack> <unpack>false</unpack>

View File

@ -34,10 +34,8 @@
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"> <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
<!-- You can use Spring XML syntax to define the routes here using the <route> element --> <!-- You can use Spring XML syntax to define the routes here using the <route> element -->
<route> <route>
<description>Example Camel Route</description>
<from uri="activemq:example.A"/> <from uri="activemq:example.A"/>
<to uri="activemq:example.B"/> <to uri="activemq:example.B"/>
</route> </route>

38
pom.xml
View File

@ -46,8 +46,7 @@
<ant-version>1.10.14</ant-version> <ant-version>1.10.14</ant-version>
<aries-version>1.1.0</aries-version> <aries-version>1.1.0</aries-version>
<axion-version>1.0-M3-dev</axion-version> <axion-version>1.0-M3-dev</axion-version>
<camel-version>2.25.4</camel-version> <camel-version>4.1.0</camel-version>
<camel-version-range>[2.20,4)</camel-version-range>
<commons-beanutils-version>1.9.4</commons-beanutils-version> <commons-beanutils-version>1.9.4</commons-beanutils-version>
<commons-collections-version>3.2.2</commons-collections-version> <commons-collections-version>3.2.2</commons-collections-version>
<commons-daemon-version>1.3.4</commons-daemon-version> <commons-daemon-version>1.3.4</commons-daemon-version>
@ -215,7 +214,6 @@
<module>activemq-all</module> <module>activemq-all</module>
<module>activemq-console</module> <module>activemq-console</module>
<module>activemq-jaas</module> <module>activemq-jaas</module>
<module>activemq-karaf</module>
<module>activemq-jms-pool</module> <module>activemq-jms-pool</module>
<module>activemq-pool</module> <module>activemq-pool</module>
<module>activemq-cf</module> <module>activemq-cf</module>
@ -227,10 +225,11 @@
<module>activemq-runtime-config</module> <module>activemq-runtime-config</module>
<module>activemq-tooling</module> <module>activemq-tooling</module>
<module>activemq-web</module> <module>activemq-web</module>
<module>activemq-osgi</module>
<module>activemq-blueprint</module>
<module>activemq-web-demo</module> <module>activemq-web-demo</module>
<module>activemq-web-console</module> <module>activemq-web-console</module>
<module>activemq-karaf</module>
<module>activemq-osgi</module>
<module>activemq-blueprint</module>
<module>activemq-karaf-itest</module> <module>activemq-karaf-itest</module>
<module>assembly</module> <module>assembly</module>
<module>activemq-log4j-appender</module> <module>activemq-log4j-appender</module>
@ -515,33 +514,10 @@
<dependency> <dependency>
<groupId>org.apache.camel</groupId> <groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId> <artifactId>camel-bom</artifactId>
<version>${camel-version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>
<version>${camel-version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-blueprint</artifactId>
<version>${camel-version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jms</artifactId>
<version>${camel-version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test</artifactId>
<version>${camel-version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test-spring</artifactId>
<version>${camel-version}</version> <version>${camel-version}</version>
<type>pom</type>
<scope>import</scope>
</dependency> </dependency>
<dependency> <dependency>