SpringBoot + Camel REST API
Репозиторий на GitHub: https://github.com/cherepakhin/simple_boot_camel
echo $JAVA_HOME
/usr/lib/jvm/java-1.8.0-openjdk-amd64
Запуск:
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64 ./mvnw spring-boot:run
http://127.0.0.1:8080/camel-rest/api-doc
Запрос:
http :8080/camel-rest/books/
http://127.0.0.1:8080/camel-rest/books/
Ответ:
[
{
"isbn": "1",
"title": "This is book 1"
},
{
"isbn": "2",
"title": "This is book 2"
},
{
"isbn": "3",
"title": "This is book 3"
},
{
"isbn": "4",
"title": "This is book 4"
},
{
"isbn": "5",
"title": "This is book 5"
},
{
"isbn": "6",
"title": "This is book 6"
},
{
"isbn": "7",
"title": "This is book 7"
},
{
"isbn": "8",
"title": "This is book 8"
},
{
"isbn": "9",
"title": "This is book 9"
}
]
Запрос "/books/9":
http :8080/camel-rest/books/9
http://127.0.0.1:8080/camel-rest/books/9
Ответ:
id: 9
{
"isbn": "9",
"title": "This is book 9"
}
Служебные запросы
Запрос "/beans":
Ответ:
Запрос "/mappings":
http://127.0.0.1:8080/mappings
Ответ:
Запрос "/error":
Ответ:
{
"error": "None",
"message": "No message available",
"status": 999,
"timestamp": 1781121228131
}
Запрос "/metrics":
Ответ:
Запрос "/health.json":
http://127.0.0.1:8080/health.json
Ответ:
{
"camel": {
"contextStatus": "Started",
"name": "SpringBootCamel",
"status": "UP",
"version": "2.20.0"
},
"camel-health-checks": {
"route:book-api": "UP",
"route:books-api": "UP",
"route:doc-api": "UP",
"status": "UP"
},
"diskSpace": {
"free": 3200131072,
"status": "UP",
"threshold": 10485760,
"total": 204755746816
},
"status": "UP"
}
Запрос "/trace.json":
http://127.0.0.1:8080/trace.json
Выводит историю запросов
Ссылки с моего github:
- Два слова о Camel
- Использование Apache Camel с Kotlin и Spring Boot (https://github.com/cherepakhin/camel_rest)
- Camel в application.yaml (https://github.com/cherepakhin/camel_rest/blob/dev/src/main/resources/application.yaml)
- Простой проект с Java, Spring Boot, Camel https://github.com/cherepakhin/camel_boot_rest
- Camel + Spring (https://github.com/cherepakhin/camel_spring)
- Простой проект с Java, Spring Boot, Camel https://github.com/cherepakhin/camel_boot_rest
- https://github.com/cherepakhin/simple_boot_camel
- https://github.com/cherepakhin/spring-boot-camel-mongo-embedded
- https://github.com/cherepakhin/cherepakhin-spring-boot-camel-praktik
- https://github.com/cherepakhin/camel_boot_kafka_read
- https://github.com/cherepakhin/camel_rest_restassured_test
- https://github.com/cherepakhin/camel_kafka_consumer_extdto
- https://github.com/cherepakhin/camel_spring_k (Kotlin)
- https://github.com/cherepakhin/spring-boot-camel
- https://github.com/cherepakhin/camel-sample
Ссылки:
- https://camel.apache.org/
- Apache Camel Development Guide
- Учебное пособие по Apache Camel
- Apache Camel и Spring Boot(Habr)
- Интеграционные RestAssured тесты для проекта camel_rest
- Apache Camel with Spring Boot
- Apache Camel: How to Expose Rest API
- Apache Camel REST DSL
- Spring Boot Example with Camel REST DSL and Platform HTTP
- Welcome to the Apache Camel Spring-Boot Examples
- Writing Your First Camel Spring Boot Project With the Rest DSL
- Getting Started with Camel Spring Boot
- Get started with REST services with Apache Camel
- Таблица соответствия версий Camel и Spring Boot:
(Установка нужной версии Java)
$ camel version list --runtime=spring-boot --minimum-version=3.0 CAMEL VERSION SPRING-BOOT JDK KIND RELEASED SUPPORTED UNTIL 3.1.0 2.2.4.RELEASE 8,11 February 2020 3.2.0 2.2.6.RELEASE 8,11 April 2020 3.3.0 2.2.7.RELEASE 8,11 May 2020 3.4.0 2.3.0.RELEASE 8,11 LTS June 2020 June 2021 3.4.1 2.3.1.RELEASE 8,11 LTS July 2020 June 2021 3.4.2 2.3.1.RELEASE 8,11 LTS July 2020 June 2021 3.4.3 2.3.2.RELEASE 8,11 LTS August 2020 June 2021 3.4.4 2.3.4.RELEASE 8,11 LTS September 2020 June 2021 3.4.5 2.3.4.RELEASE 8,11 LTS December 2020 June 2021 3.4.6 2.3.10.RELEASE 8,11 LTS June 2021 June 2021 3.5.0 2.3.3.RELEASE 8,11 September 2020 3.6.0 2.3.4.RELEASE 8,11 September 2020 3.7.0 2.4.0 8,11 LTS December 2020 January 2022 3.7.1 2.4.2 8,11 LTS January 2021 January 2022 3.7.2 2.4.2 8,11 LTS February 2021 January 2022 3.7.3 2.4.3 8,11 LTS March 2021 January 2022 3.7.4 2.4.5 8,11 LTS May 2021 January 2022 3.7.5 2.4.8 8,11 LTS July 2021 January 2022 3.7.6 2.4.11 8,11 LTS October 2021 January 2022 3.7.7 2.4.11 8,11 LTS December 2021 January 2022 3.8.0 2.4.2 8,11 February 2021 3.9.0 2.4.4 8,11 March 2021 3.10.0 2.4.5 8,11 May 2021 3.11.0 2.5.1 8,11 LTS June 2021 July 2022 3.11.1 2.5.3 8,11 LTS August 2021 July 2022 3.11.2 2.5.4 8,11 LTS September 2021 July 2022 3.11.3 2.5.5 8,11 LTS October 2021 July 2022 3.11.4 2.5.6 8,11 LTS November 2021 July 2022 3.11.5 2.5.8 8,11 LTS December 2021 July 2022 3.11.6 2.5.10 8,11 LTS March 2022 July 2022 3.11.7 2.5.13 8,11 LTS May 2022 July 2022 3.12.0 2.5.5 8,11 October 2021 3.13.0 2.5.6 8,11 November 2021 3.14.0 2.6.1 8,11 LTS December 2021 December 2023 3.14.1 2.6.3 8,11 LTS January 2022 December 2023 3.14.2 2.6.4 8,11 LTS March 2022 December 2023 3.14.3 2.6.7 8,11 LTS May 2022 December 2023 3.14.4 2.6.8 8,11 LTS June 2022 December 2023 3.14.5 2.6.10 8,11 LTS August 2022 December 2023 3.14.6 2.6.13 8,11 LTS November 2022 December 2023 3.14.7 2.6.13 8,11 LTS December 2022 December 2023 3.15.0 2.6.3 11 February 2022 3.16.0 2.6.4 11 March 2022 3.17.0 2.6.7 11,17 May 2022 3.18.0 2.7.1 11,17 LTS July 2022 July 2023 3.18.1 2.7.2 11,17 LTS August 2022 July 2023 3.18.2 2.7.3 11,17 LTS September 2022 July 2023 3.18.3 2.7.5 11,17 LTS October 2022 July 2023 3.18.4 2.7.6 11,17 LTS December 2022 July 2023 3.18.5 2.7.8 11,17 LTS January 2023 July 2023 3.18.6 2.7.8 11,17 LTS April 2023 July 2023 3.19.0 2.7.3 11,17 October 2022 3.20.0 2.7.6 11,17 LTS December 2022 December 2023 3.20.1 2.7.7 11,17 LTS January 2023 December 2023 3.20.2 2.7.8 11,17 LTS February 2023 December 2023 3.20.3 2.7.10 11,17 LTS March 2023 December 2023 4.0.0-M1 3.0.2 17 RC February 2023 4.0.0-M2 3.0.4 17 RC March 2023 - Spring Boot – Using Spring Boot with Apache Camel