Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6861443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:32:08+00:00 2026-05-27T02:32:08+00:00

I am completely clueless of what I am doing wrong. Below are the 2

  • 0

I am completely clueless of what I am doing wrong. Below are the 2 code snippets that works. But if I need to place the processor of snippet-2 in snippet-1 it doesn’t work. How can I find out the reason?

Working snippet -1

from("file:inbox")
      .multicast()
      .to("seda:a")
      .choice()
         .when(header("foo").isEqualTo("one"))
         .to("log:org.apache.camel.DeadLetterChannel?level=error")
         .otherwise()
         .to("file://d://log//camel//output1<file:///d://log//camel//output1>")
       .to("seda:b")
        .choice()
        .when(header("foo").isEqualTo("one"))
        .to("log:org.apache.camel.DeadLetterChannel?level=error")
        .otherwise()
        .to("file://d://log//camel//output2<file:///d://log//camel//output2>");

Working snippet -2

    from("file:inbox")
      .multicast()
    .process(new MutlicastRecoveryProcessor (“output1”))
                                .to    ("file://d://log//camel//output1<file:///d://log//camel//output1>")
                . process(new MutlicastRecoveryProcessor (“output2”))
                                .to("file://d://log//camel//output2<file:///d://log//camel//output2>");

class MutlicastRecoveryProcessor implements Processor {

private String endpointSeqID;
            public MutlicastRecoveryProcessor(String endpointSeqID) {

                  this.endpointSeqID = endpointSeqID;
            }
            @Override
            public void process(Exchange exchange) throws Exception {

                  if (“output1”.equals(this.endpointSeqID)) {
                      exchange.getIn().setHeader(“foo”,”one”);
                  }
            }
}

Non Working snippet -1

from("file:inbox")
      .multicast()
.process(new MutlicastRecoveryProcessor (“output1”))
         .to("seda:a")
         .choice()
         .when(header("foo").isEqualTo("one"))
         .to("log:org.apache.camel.DeadLetterChannel?level=error")
         .otherwise()
         .to("file://d://log//camel//output1<file:///d://log//camel//output1>")
.process(new MutlicastRecoveryProcessor (“output2”))
        .to("seda:b")
        .choice()
        .when(header("foo").isEqualTo("one"))
        .to("log:org.apache.camel.DeadLetterChannel?level=error")
        .otherwise()
        .to("file://d://log//camel//output2<file:///d://log//camel//output2>");

class MutlicastRecoveryProcessor implements Processor {

private String endpointSeqID;
            public MutlicastRecoveryProcessor(String endpointSeqID) {

                  this.endpointSeqID = endpointSeqID;
            }
            @Override
            public void process(Exchange exchange) throws Exception {

                  if (“output1”.equals(this.endpointSeqID)) {
                      exchange.getIn().setHeader(“foo”,”one”);
                  }
            }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:32:08+00:00Added an answer on May 27, 2026 at 2:32 am

    Something like this finally worked.

    class MutlicastRecoveryProcessor implements Processor {
                private String endpointSeq;
    
                public MutlicastRecoveryProcessor(String endpointSeq) {
                    this.endpointSeq = endpointSeq;
                }
    
                @Override
                public void process(Exchange exchange) throws Exception {
                    if ("output1".equals(this.endpointSeq)) {
                        exchange.getIn().setHeader("foo", "one");
                    } else {
                        System.out.println("endpoint " + this.endpointSeq);
                    }
                }
            }
    
            CamelContext context = new DefaultCamelContext();
    
            context.addRoutes(new RouteBuilder() {
    
                public void configure() {
                    from("file://d://log//camel").convertBodyTo(String.class)
                            .multicast().to("seda:a", "seda:b");
    
                    from("seda:a")
                            .process(new MutlicastRecoveryProcessor("output1"))
                            .choice()
                            .when(header("foo").isEqualTo("one"))
                            .to("log:org.apache.camel.DeadLetterChannel?level=error")
                            .otherwise().to("file://c://log//camel//output1");
    
                    from("seda:b")
                            .process(new MutlicastRecoveryProcessor("output2"))
                            .choice()
                            .when(header("foo").isEqualTo("one"))
                            .to("log:org.apache.camel.DeadLetterChannel?level=error")
                            .otherwise().to("file://d://log//camel//output2");
    
                }
            });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Disclaimer: I'm completely clueless about .net and COM. I have a vendor's application that
I'm getting the (probably trivial) error, but completely clueless about the possible causes. I
Not completely a programming question, but its close enough so here goes: In Mac
I'm completely new to COBOL, but I'd like to take a look at the
I am completely new to flash. We need to load a binary file from
Probably missing something completely obvious here, but here goes. I'm starting out with Spring
I'm completely stuck and need your help... I've created a webservice stub with jaxb
Completely new to Objective-C, trying to find out when I need to alloc and
I completely messed up my code and did not change the Movieclip names when
I'm, quite frankly, completely clueless about Regular expression, more so building them. I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.