0

I have a route that has to be asynchronously consumed and I'm using an direct component to refers to it as an alias.

    <route id="producer_CUSTOMER_INTERACTIONS_ISSUES_RELATIONSHIPS_Topic">
        <from uri="direct:test"/>
        <pollEnrich aggregateOnException="false" id="pollEnrich1" timeout="-1">
            <constant>file:mock/customer-interactions-issues-relationships?noop=true&amp;idempotent=false</constant>
        </pollEnrich>
        <to uri="kafka:customer-interactions-issues-relationships?brokers=localhost:9092"/>
    </route>

That route has to be consumed by:

<route id="1"><from uri="timer://foo?fixedRate=true&amp;period=1&amp;repeatCount=1000"/><to uri="direct:test"/></route>
<route id="2"><from uri="timer://foo?fixedRate=true&amp;period=1&amp;repeatCount=1000"/><to uri="direct:test"/></route>
<route id="3"><from uri="timer://foo?fixedRate=true&amp;period=1&amp;repeatCount=1000"/><to uri="direct:test"/></route>
<route id="4"><from uri="timer://foo?fixedRate=true&amp;period=1&amp;repeatCount=1000"/><to uri="direct:test"/></route>

I would like that each consumer route requests 1000x the mock content of producer_CUSTOMER_INTERACTIONS_ISSUES_RLATIONSHIPS_Topic asyncrhonously, but, right now, it's syncrhonous as follows:

enter image description here

I've read about a SEDA component in Camel Documentation, but there isn't any example about how to use it in Blueprints :(

Hugo Deiró
  • 224
  • 2
  • 13
  • What do u mean they're running synchronously ? – Chuck Jul 04 '18 at 08:41
  • They're inflight one by time. – Hugo Deiró Jul 04 '18 at 12:16
  • but that's because you schedule them in the same period, right? they should be inflight. You can you a timer to created events and route it into a thread routes. I think that'll be what you want to achieve. – Chuck Jul 05 '18 at 08:54
  • Yes, but what I needed was that each route that reffers to the producer_CUSTOMER_INTERACTIONS_ISSUES_RELATIONSHIPS_Topic be inflight at same time. :p – Hugo Deiró Jul 06 '18 at 11:25

1 Answers1

1

In order to help other people that need to do something like this, I've solved this problem using:

<route id="1"><from uri="timer://foo?fixedRate=true&amp;period=1&amp;repeatCount=1000&amp;delay=-1"/><to uri="direct:test"/></route>

I just added delay=-1 to force it run asynchronously.

I really don't know if it is the beast approach. If someone else has a better answer, please, post it to help =)

Hugo Deiró
  • 224
  • 2
  • 13