Skip to content

This template will help you to expose rest api using apache Camel and springboot.

Notifications You must be signed in to change notification settings

NashTech-Labs/Apache-Camel-SpringBoot-REST-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spring-camel-rest-dsl

How to expose Rest API using Spring Boot with Apache Camel

Dependencies we have to add for apache camel

org.apache.camel camel-spring-boot-starter 2.24.0 org.apache.camel camel-servlet-starter 2.24.0 org.apache.camel camel-jackson 2.24.0

Rest APIs

Post method

restConfiguration().component("servlet").port(9090).host("localhost").bindingMode(RestBindingMode.json);

	rest().post("/addOrder").consumes(MediaType.APPLICATION_JSON_VALUE).type(Order.class).outType(Order.class)
			.route().process(processor).endRest();

http://localhost:9090/addStudent

{

"name":"akshit",

"email":"akshit@gmail.com",

"course":"MCA"

}

Get method

http://localhost:9090/getStudent

it will return all students list

About

This template will help you to expose rest api using apache Camel and springboot.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages