Creating message queue in spring boot using apache camelWhat exactly is Apache Camel?How to use Apache Camel correctly for specific scenario?Apache Camel: can message have multiple objects in body (with different classes)?How to configure port for a Spring Boot applicationApache Camel: MailMessage email Headers are emptyapache-camel apache-cxf IllegalStateException: Could not register object under bean name 'cxf': there is already object boundHow are ProducerTemplate and Apache Camel routes linked in Spring application?Spring Boot Camel Testing - No consumers available on endpointspring boot,No qualifying bean of type found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependencyExpected at least 1 bean which qualifies as autowire candidate for this dependency, No qualifying bean of type found for dependency
How major are these paintwork & rust problems?
How offensive is the French word "femmelette" considered to be?
How to publish superseding results without creating enemies
What jurisdiction do Scottish courts have over the Westminster parliament?
What was the ultimate objective of The Party in 1984?
I was promised a work PC but still awaiting approval 3 months later so using my own laptop - Is it fair to ask employer for laptop insurance?
Is there a tool to measure the "maturity" of a code in Git?
Real mode flat model
Ambiguity in notation resolved by +
Should you only use colons and periods in dialogues?
Some Prime Peerage
Why are some files not movable on Windows 10?
Are there any “Third Order” acronyms used in space exploration?
How does a linear operator act on a bra?
Write a function that returns an iterable object of all valid points 4-directionally adjacent to (x, y)
Is Schwarzschild's solution in his original paper consistent with current solutions?
How can I discourage sharing internal API keys within a company?
Can I fix my boots by gluing the soles back on?
Is using gradient descent for MIP a good idea?
Should I leave the first authorship of our paper to the student who did the project whereas I solved it?
In a hashmap, the addition of a new element to the internal linked list of a bucket is always at the end. Why?
Why is the year in this ISO timestamp not 2019?
What makes a smart phone "kosher"?
What is this gigantic dish at Ben Gurion airport?
Creating message queue in spring boot using apache camel
What exactly is Apache Camel?How to use Apache Camel correctly for specific scenario?Apache Camel: can message have multiple objects in body (with different classes)?How to configure port for a Spring Boot applicationApache Camel: MailMessage email Headers are emptyapache-camel apache-cxf IllegalStateException: Could not register object under bean name 'cxf': there is already object boundHow are ProducerTemplate and Apache Camel routes linked in Spring application?Spring Boot Camel Testing - No consumers available on endpointspring boot,No qualifying bean of type found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependencyExpected at least 1 bean which qualifies as autowire candidate for this dependency, No qualifying bean of type found for dependency
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm very newbie to this messaging queue and just started learning some basic stuffs in this.
So for our spring boot application we followed an architecture like contoller talks to service & service talks to repository so here i have to create one controller that will accept a class DTO as a json and post these information to the message queue specified in the apache camel.
I'm following this link ! for my reference that works well but when i tried to implement it in my project , it saying me an error listed below.
Error
Exception encountered during context initialization - cancelling
refresh attempt:
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'trackerQueueController': Unsatisfied
dependency expressed through field 'camelContext'; nested exception is
org.springframework.beans.factory.NoSuchBeanDefinitionException: No
qualifying bean of type 'org.apache.camel.CamelContext' available:
expected at least 1 bean which qualifies as autowire candidate.
Dependency annotations:
@org.springframework.beans.factory.annotation.Autowired(required=true)
I have created an controller,routes & processor as below:
Controller
@RestController
@RequestMapping("/deviceinfo")
public class TrackerQueueController
@Autowired
CamelContext camelContext;
@Autowired
private
ProducerTemplate producerTemplate;
@PostMapping()
public void startCamel(@RequestBody FieldUpdate fieldUpdate)
producerTemplate.sendBody("activemq:topic:in", fieldUpdate);
Routes
@Component
public class TrackerQueueRoutes extends RouteBuilder
@Override
public void configure() throws Exception
from("activemq:topic:in")
.process(new TrackerProcessor()
@Override
public void process(Exchange exchange) throws
Exception
log.info("I'm in");
FieldUpdate body =
exchange.getIn().getBody(FieldUpdate.class);
log.info("Hello from camel processed message!
Received payload: " , body.getSerialNumber());
exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE,
HttpStatus.ACCEPTED);
);
Processor
public class TrackerProcessor implements Processor
@Override
public void process(Exchange exchange) throws Exception
Can any one provide me some tutorial link that fulfil my need or any ideas.
spring spring-boot apache-camel
add a comment
|
I'm very newbie to this messaging queue and just started learning some basic stuffs in this.
So for our spring boot application we followed an architecture like contoller talks to service & service talks to repository so here i have to create one controller that will accept a class DTO as a json and post these information to the message queue specified in the apache camel.
I'm following this link ! for my reference that works well but when i tried to implement it in my project , it saying me an error listed below.
Error
Exception encountered during context initialization - cancelling
refresh attempt:
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'trackerQueueController': Unsatisfied
dependency expressed through field 'camelContext'; nested exception is
org.springframework.beans.factory.NoSuchBeanDefinitionException: No
qualifying bean of type 'org.apache.camel.CamelContext' available:
expected at least 1 bean which qualifies as autowire candidate.
Dependency annotations:
@org.springframework.beans.factory.annotation.Autowired(required=true)
I have created an controller,routes & processor as below:
Controller
@RestController
@RequestMapping("/deviceinfo")
public class TrackerQueueController
@Autowired
CamelContext camelContext;
@Autowired
private
ProducerTemplate producerTemplate;
@PostMapping()
public void startCamel(@RequestBody FieldUpdate fieldUpdate)
producerTemplate.sendBody("activemq:topic:in", fieldUpdate);
Routes
@Component
public class TrackerQueueRoutes extends RouteBuilder
@Override
public void configure() throws Exception
from("activemq:topic:in")
.process(new TrackerProcessor()
@Override
public void process(Exchange exchange) throws
Exception
log.info("I'm in");
FieldUpdate body =
exchange.getIn().getBody(FieldUpdate.class);
log.info("Hello from camel processed message!
Received payload: " , body.getSerialNumber());
exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE,
HttpStatus.ACCEPTED);
);
Processor
public class TrackerProcessor implements Processor
@Override
public void process(Exchange exchange) throws Exception
Can any one provide me some tutorial link that fulfil my need or any ideas.
spring spring-boot apache-camel
Do you have camel-spring-boot-starter as dependency. See for example the camel spring boot examples at: github.com/apache/camel/tree/camel-2.x/examples
– Claus Ibsen
Mar 28 at 13:03
add a comment
|
I'm very newbie to this messaging queue and just started learning some basic stuffs in this.
So for our spring boot application we followed an architecture like contoller talks to service & service talks to repository so here i have to create one controller that will accept a class DTO as a json and post these information to the message queue specified in the apache camel.
I'm following this link ! for my reference that works well but when i tried to implement it in my project , it saying me an error listed below.
Error
Exception encountered during context initialization - cancelling
refresh attempt:
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'trackerQueueController': Unsatisfied
dependency expressed through field 'camelContext'; nested exception is
org.springframework.beans.factory.NoSuchBeanDefinitionException: No
qualifying bean of type 'org.apache.camel.CamelContext' available:
expected at least 1 bean which qualifies as autowire candidate.
Dependency annotations:
@org.springframework.beans.factory.annotation.Autowired(required=true)
I have created an controller,routes & processor as below:
Controller
@RestController
@RequestMapping("/deviceinfo")
public class TrackerQueueController
@Autowired
CamelContext camelContext;
@Autowired
private
ProducerTemplate producerTemplate;
@PostMapping()
public void startCamel(@RequestBody FieldUpdate fieldUpdate)
producerTemplate.sendBody("activemq:topic:in", fieldUpdate);
Routes
@Component
public class TrackerQueueRoutes extends RouteBuilder
@Override
public void configure() throws Exception
from("activemq:topic:in")
.process(new TrackerProcessor()
@Override
public void process(Exchange exchange) throws
Exception
log.info("I'm in");
FieldUpdate body =
exchange.getIn().getBody(FieldUpdate.class);
log.info("Hello from camel processed message!
Received payload: " , body.getSerialNumber());
exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE,
HttpStatus.ACCEPTED);
);
Processor
public class TrackerProcessor implements Processor
@Override
public void process(Exchange exchange) throws Exception
Can any one provide me some tutorial link that fulfil my need or any ideas.
spring spring-boot apache-camel
I'm very newbie to this messaging queue and just started learning some basic stuffs in this.
So for our spring boot application we followed an architecture like contoller talks to service & service talks to repository so here i have to create one controller that will accept a class DTO as a json and post these information to the message queue specified in the apache camel.
I'm following this link ! for my reference that works well but when i tried to implement it in my project , it saying me an error listed below.
Error
Exception encountered during context initialization - cancelling
refresh attempt:
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'trackerQueueController': Unsatisfied
dependency expressed through field 'camelContext'; nested exception is
org.springframework.beans.factory.NoSuchBeanDefinitionException: No
qualifying bean of type 'org.apache.camel.CamelContext' available:
expected at least 1 bean which qualifies as autowire candidate.
Dependency annotations:
@org.springframework.beans.factory.annotation.Autowired(required=true)
I have created an controller,routes & processor as below:
Controller
@RestController
@RequestMapping("/deviceinfo")
public class TrackerQueueController
@Autowired
CamelContext camelContext;
@Autowired
private
ProducerTemplate producerTemplate;
@PostMapping()
public void startCamel(@RequestBody FieldUpdate fieldUpdate)
producerTemplate.sendBody("activemq:topic:in", fieldUpdate);
Routes
@Component
public class TrackerQueueRoutes extends RouteBuilder
@Override
public void configure() throws Exception
from("activemq:topic:in")
.process(new TrackerProcessor()
@Override
public void process(Exchange exchange) throws
Exception
log.info("I'm in");
FieldUpdate body =
exchange.getIn().getBody(FieldUpdate.class);
log.info("Hello from camel processed message!
Received payload: " , body.getSerialNumber());
exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE,
HttpStatus.ACCEPTED);
);
Processor
public class TrackerProcessor implements Processor
@Override
public void process(Exchange exchange) throws Exception
Can any one provide me some tutorial link that fulfil my need or any ideas.
spring spring-boot apache-camel
spring spring-boot apache-camel
edited Mar 28 at 10:56
Mebin Joe
1,2181 gold badge11 silver badges20 bronze badges
1,2181 gold badge11 silver badges20 bronze badges
asked Mar 28 at 10:52
Pranesh sawPranesh saw
186 bronze badges
186 bronze badges
Do you have camel-spring-boot-starter as dependency. See for example the camel spring boot examples at: github.com/apache/camel/tree/camel-2.x/examples
– Claus Ibsen
Mar 28 at 13:03
add a comment
|
Do you have camel-spring-boot-starter as dependency. See for example the camel spring boot examples at: github.com/apache/camel/tree/camel-2.x/examples
– Claus Ibsen
Mar 28 at 13:03
Do you have camel-spring-boot-starter as dependency. See for example the camel spring boot examples at: github.com/apache/camel/tree/camel-2.x/examples
– Claus Ibsen
Mar 28 at 13:03
Do you have camel-spring-boot-starter as dependency. See for example the camel spring boot examples at: github.com/apache/camel/tree/camel-2.x/examples
– Claus Ibsen
Mar 28 at 13:03
add a comment
|
1 Answer
1
active
oldest
votes
As Claus Ibsen suggested in the comments, you have to add these dependencies to your POM file
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring-boot-starter</artifactId>
<version>[camel-version]</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
camel-spring-boot-starterautomatically starts aCamelContextfor you, discovers routes etcspring-boot-starter-webkeeps your application running by listening for web requests. Otherwise it would immediately shut down after startup because there is nothing to execute.
Since your Camel route class is correctly annotated (@Component) and subclassed (extends RouteBuilder), it should be auto-discovered by the Camel SpringBoot starter.
See the Camel-SpringBoot docs for all these topics and more.
add a comment
|
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55395763%2fcreating-message-queue-in-spring-boot-using-apache-camel%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
As Claus Ibsen suggested in the comments, you have to add these dependencies to your POM file
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring-boot-starter</artifactId>
<version>[camel-version]</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
camel-spring-boot-starterautomatically starts aCamelContextfor you, discovers routes etcspring-boot-starter-webkeeps your application running by listening for web requests. Otherwise it would immediately shut down after startup because there is nothing to execute.
Since your Camel route class is correctly annotated (@Component) and subclassed (extends RouteBuilder), it should be auto-discovered by the Camel SpringBoot starter.
See the Camel-SpringBoot docs for all these topics and more.
add a comment
|
As Claus Ibsen suggested in the comments, you have to add these dependencies to your POM file
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring-boot-starter</artifactId>
<version>[camel-version]</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
camel-spring-boot-starterautomatically starts aCamelContextfor you, discovers routes etcspring-boot-starter-webkeeps your application running by listening for web requests. Otherwise it would immediately shut down after startup because there is nothing to execute.
Since your Camel route class is correctly annotated (@Component) and subclassed (extends RouteBuilder), it should be auto-discovered by the Camel SpringBoot starter.
See the Camel-SpringBoot docs for all these topics and more.
add a comment
|
As Claus Ibsen suggested in the comments, you have to add these dependencies to your POM file
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring-boot-starter</artifactId>
<version>[camel-version]</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
camel-spring-boot-starterautomatically starts aCamelContextfor you, discovers routes etcspring-boot-starter-webkeeps your application running by listening for web requests. Otherwise it would immediately shut down after startup because there is nothing to execute.
Since your Camel route class is correctly annotated (@Component) and subclassed (extends RouteBuilder), it should be auto-discovered by the Camel SpringBoot starter.
See the Camel-SpringBoot docs for all these topics and more.
As Claus Ibsen suggested in the comments, you have to add these dependencies to your POM file
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring-boot-starter</artifactId>
<version>[camel-version]</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
camel-spring-boot-starterautomatically starts aCamelContextfor you, discovers routes etcspring-boot-starter-webkeeps your application running by listening for web requests. Otherwise it would immediately shut down after startup because there is nothing to execute.
Since your Camel route class is correctly annotated (@Component) and subclassed (extends RouteBuilder), it should be auto-discovered by the Camel SpringBoot starter.
See the Camel-SpringBoot docs for all these topics and more.
answered Mar 28 at 16:07
burkiburki
2,6671 gold badge6 silver badges20 bronze badges
2,6671 gold badge6 silver badges20 bronze badges
add a comment
|
add a comment
|
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55395763%2fcreating-message-queue-in-spring-boot-using-apache-camel%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Do you have camel-spring-boot-starter as dependency. See for example the camel spring boot examples at: github.com/apache/camel/tree/camel-2.x/examples
– Claus Ibsen
Mar 28 at 13:03