Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions activemq/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.camel.springboot.example</groupId>
<artifactId>examples</artifactId>
<version>4.18.0-SNAPSHOT</version>
<version>4.19.0-SNAPSHOT</version>
</parent>

<artifactId>camel-example-spring-boot-activemq</artifactId>
Expand Down Expand Up @@ -68,7 +68,7 @@
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<artifactId>spring-boot-starter-webmvc</artifactId>
</dependency>
<!-- Camel -->
<dependency>
Expand All @@ -92,7 +92,7 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test-spring-junit5</artifactId>
<artifactId>camel-test-spring-junit6</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
14 changes: 3 additions & 11 deletions activemq/readme.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,11 @@ This example shows how to work with a simple Apache Camel application using Spri
In contrast to the amqp example in this repo, it uses ActiveMQs openwire protocol and the
camel-activemq component.

=== Preparing ActiveMQ brokers

From Apache ActiveMQ you can download the broker as a `.zip` or `.tar.gz` file.

Unzip/tar the archive, and start a terminal.

Change directory to the unzipped directory and start the broker.

bin/activemq console
=== How to run the example

Which runs the broker in the foreground and logs to the console.
You need a running ActiveMQ broker. You can use the Camel CLI to start an Artemis broker:

=== How to run the example
camel infra run artemis

You can run this example using

Expand Down
6 changes: 2 additions & 4 deletions activemq/src/main/java/sample/camel/SampleAmqApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,15 @@
package sample.camel;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import org.springframework.boot.autoconfigure.jms.activemq.ActiveMQAutoConfiguration;
import org.springframework.boot.activemq.autoconfigure.ActiveMQAutoConfiguration;

/* Disable ActiveMQAutoConfiguration to prevent Spring Boot from creating a
default ConnectionFactory. This allows us to configure our own ConnectionFactory
via camel.component.activemq properties in application.properties.
*/
@SpringBootApplication
@EnableAutoConfiguration(exclude = {ActiveMQAutoConfiguration.class})
@SpringBootApplication(exclude = {ActiveMQAutoConfiguration.class})
public class SampleAmqApplication {

public static void main(String[] args) {
Expand Down
4 changes: 2 additions & 2 deletions activemq/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ camel.main.run-controller = true

# camel-activemq config
camel.component.activemq.broker-url=tcp://localhost:61616
camel.component.activemq.username=admin
camel.component.activemq.password=admin
camel.component.activemq.username=artemis
camel.component.activemq.password=artemis
camel.component.activemq.use-pooled-connection=true
camel.component.activemq.use-single-connection=false
camel.component.activemq.cache-level-name=CACHE_CONSUMER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import org.apache.camel.CamelContext;
import org.apache.camel.builder.NotifyBuilder;
import org.apache.camel.test.spring.junit5.CamelSpringBootTest;
import org.apache.camel.test.spring.junit6.CamelSpringBootTest;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Disabled;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -30,7 +30,7 @@

@CamelSpringBootTest
@SpringBootTest(classes = SampleAmqApplication.class)
public class SampleAmqApplicationTests {
public class SampleAmqApplicationTest {
@Autowired
private CamelContext camelContext;

Expand Down
4 changes: 2 additions & 2 deletions actuator-http-metrics/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.camel.springboot.example</groupId>
<artifactId>examples</artifactId>
<version>4.18.0-SNAPSHOT</version>
<version>4.19.0-SNAPSHOT</version>
</parent>

<artifactId>camel-example-spring-boot-actuator-http-metrics</artifactId>
Expand Down Expand Up @@ -62,7 +62,7 @@
<!-- Spring Boot -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<artifactId>spring-boot-starter-webmvc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ logging.level.org.apache.camel.impl.health = DEBUG
logging.level.sample.camel = DEBUG

# enable the shutdown endpoint
management.endpoint.shutdown.enabled=true
management.endpoint.shutdown.access=read-only

# expose actuator endpoint via HTTP
management.endpoints.web.exposure.include=mappings,metrics,shutdown
Expand Down
6 changes: 3 additions & 3 deletions ai-agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.camel.springboot.example</groupId>
<artifactId>examples</artifactId>
<version>4.18.0-SNAPSHOT</version>
<version>4.19.0-SNAPSHOT</version>
</parent>

<artifactId>camel-example-spring-boot-ai-agent</artifactId>
Expand All @@ -36,7 +36,7 @@

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<spring-ai-version>1.1.0</spring-ai-version>
<spring-ai-version>2.0.0-M2</spring-ai-version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -120,7 +120,7 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test-spring-junit5</artifactId>
<artifactId>camel-test-spring-junit6</artifactId>
<version>${camel-version}</version>
<scope>test</scope>
</dependency>
Expand Down
6 changes: 3 additions & 3 deletions amqp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.camel.springboot.example</groupId>
<artifactId>examples</artifactId>
<version>4.18.0-SNAPSHOT</version>
<version>4.19.0-SNAPSHOT</version>
</parent>

<artifactId>camel-example-spring-boot-amqp</artifactId>
Expand Down Expand Up @@ -65,7 +65,7 @@

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<artifactId>spring-boot-starter-webmvc</artifactId>
</dependency>

<!-- Camel -->
Expand All @@ -91,7 +91,7 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test-spring-junit5</artifactId>
<artifactId>camel-test-spring-junit6</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
14 changes: 3 additions & 11 deletions amqp/readme.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,11 @@

This example shows how to work with a simple Apache Camel application using Spring Boot and Apache ActiveMQ.

=== Preparing ActiveMQ brokers

From Apache ActiveMQ you can download the broker as a `.zip` or `.tar.gz` file.

Unzip/tar the archive, and start a terminal.

Change directory to the unzipped directory and start the broker.

bin/activemq console
=== How to run the example

Which runs the broker in the foreground and logs to the console.
You need a running ActiveMQ broker. You can use the Camel CLI to start an Artemis broker:

=== How to run the example
camel infra run artemis

You can run this example using

Expand Down
8 changes: 4 additions & 4 deletions amqp/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ camel.main.run-controller = true

# JMS ConnectionFactory configuration
AMQP_REMOTE_URI=amqp://localhost:5672
AMQP_SERVICE_USERNAME=admin
AMQP_SERVICE_PASSWORD=admin
AMQP_SERVICE_USERNAME=artemis
AMQP_SERVICE_PASSWORD=artemis

# Camel AMQP config
# username and password configured here will overwrite the ones
# configured directly on the JMS ConnectionFactory
camel.component.amqp.password=admin
camel.component.amqp.username=admin
camel.component.amqp.password=artemis
camel.component.amqp.username=artemis
camel.component.amqp.cache-level-name = CACHE_CONSUMER
camel.component.amqp.connection-pooling=true
camel.component.amqp.jms-max-connections=1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import org.apache.camel.CamelContext;
import org.apache.camel.builder.NotifyBuilder;
import org.apache.camel.test.spring.junit5.CamelSpringBootTest;
import org.apache.camel.test.spring.junit6.CamelSpringBootTest;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Disabled;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -30,7 +30,7 @@

@CamelSpringBootTest
@SpringBootTest(classes = SampleAmqApplication.class)
public class SampleAmqApplicationTests {
public class SampleAmqApplicationTest {
@Autowired
private CamelContext camelContext;

Expand Down
2 changes: 1 addition & 1 deletion aot-basic/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.camel.springboot.example</groupId>
<artifactId>examples</artifactId>
<version>4.18.0-SNAPSHOT</version>
<version>4.19.0-SNAPSHOT</version>
</parent>

<artifactId>camel-example-spring-boot-aot-basic</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion aot-basic/src/main/java/sample/camel/MyBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class MyBean {

@Reflective
public String saySomething() {
return String.format("%s I am invoked %d times", say, ++counter);
return "%s I am invoked %d times".formatted(say, ++counter);
}

}
20 changes: 3 additions & 17 deletions arangodb/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,15 @@ You can build this example using:

You can run this example following these steps using:

Run an instance of ArangoDB with the root and password given in application.properties file. Example using the docker image :
Start an ArangoDB instance using the Camel CLI:

$ docker run -p 8529:8529 -e ARANGO_ROOT_PASSWORD=openSesame arangodb:latest

Execute arangosh in your server. Example with the docker image ( set "openSesame" as password)

$ docker exec -it <CONTAINER_ID> arangosh --server.username "root"

Create the database "myDb"

$ db._createDatabase("myDb")

Create the collection "foo"

$ db._useDatabase("myDb")

$ db._create("foo")
$ camel infra run arangodb

Run the app

$ mvn spring-boot:run

And you should see output in the console. You can also see the document created in the foo collection.
And you should see output in the console. You can also see the document created in the myCollection collection.

=== Help and contributions

Expand Down
2 changes: 1 addition & 1 deletion arangodb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.camel.springboot.example</groupId>
<artifactId>examples</artifactId>
<version>4.18.0-SNAPSHOT</version>
<version>4.19.0-SNAPSHOT</version>
</parent>

<artifactId>camel-example-spring-boot-arangodb</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ public void configure() throws Exception {

from("timer://foo?period=10000&repeatCount=1")
.bean(MyBeanService.class, "createDocument")
.to("arangodb:myDb?operation=SAVE_DOCUMENT")
.to("arangodb:myDatabase?operation=SAVE_DOCUMENT")
.bean(MyBeanService.class, "readDocument")
.setHeader(ArangoDbConstants.RESULT_CLASS_TYPE).constant(String.class)
.to("arangodb:myDb?operation=FIND_DOCUMENT_BY_KEY")
.to("arangodb:myDatabase?operation=FIND_DOCUMENT_BY_KEY")
.log("Received body: ${body}");
}
}
4 changes: 2 additions & 2 deletions arangodb/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
## ---------------------------------------------------------------------------
camel.main.name=ArangoDB
camel.main.run-controller=true
camel.component.arangodb.documentCollection=foo
camel.component.arangodb.documentCollection=myCollection
camel.component.arangodb.user=root
camel.component.arangodb.password=openSesame
camel.component.arangodb.password=password


6 changes: 3 additions & 3 deletions artemis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.camel.springboot.example</groupId>
<artifactId>examples</artifactId>
<version>4.18.0-SNAPSHOT</version>
<version>4.19.0-SNAPSHOT</version>
</parent>

<artifactId>camel-example-spring-boot-artemis</artifactId>
Expand Down Expand Up @@ -65,7 +65,7 @@

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<artifactId>spring-boot-starter-webmvc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -104,7 +104,7 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test-spring-junit5</artifactId>
<artifactId>camel-test-spring-junit6</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
4 changes: 4 additions & 0 deletions artemis/readme.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ This example shows how to work with a simple Apache Camel application using Spri

=== How to run the example

This example uses an embedded Artemis broker by default. Alternatively, you can start an external Artemis broker using the Camel CLI:

camel infra run artemis

You can run this example using

mvn spring-boot:run
Expand Down
2 changes: 1 addition & 1 deletion artemis/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
camel.main.run-controller = true
#spring.artemis.mode=native
spring.artemis.mode=embedded
spring.artemis.host=localhost
spring.artemis.broker-url=localhost
spring.artemis.port=61616
spring.artemis.user=test
spring.artemis.password=test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@

import org.apache.camel.CamelContext;
import org.apache.camel.builder.NotifyBuilder;
import org.apache.camel.test.spring.junit5.CamelSpringBootTest;
import org.apache.camel.test.spring.junit6.CamelSpringBootTest;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import static org.junit.jupiter.api.Assertions.assertTrue;

@CamelSpringBootTest
@SpringBootTest(classes = SampleAmqApplication.class)
public class SampleAmqApplicationTests {
public class SampleAmqApplicationTest {
@Autowired
private CamelContext camelContext;

Expand Down
2 changes: 1 addition & 1 deletion aws-secrets-manager/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.camel.springboot.example</groupId>
<artifactId>examples</artifactId>
<version>4.18.0-SNAPSHOT</version>
<version>4.19.0-SNAPSHOT</version>
</parent>

<artifactId>camel-example-spring-boot-aws-secrets-manager</artifactId>
Expand Down
Loading
Loading