czgov / camel-isds

Camel component for czech system ISDS (Informační Systém Datových Schránek).
MIT License
3 stars 0 forks source link

Support idempotent consumer #12

Closed jludvice closed 3 years ago

jludvice commented 7 years ago

http://camel.apache.org/idempotent-consumer.html

jludvice commented 7 years ago

It's already possible to use idempotent consumer in route dsl like this:

import com.github.czgov.isds.Constants;
import org.apache.camel.processor.idempotent.MemoryIdempotentRepository;

        from("isds:messages?environment=test&username=...")
                .idempotentConsumer(header(Constants.MSG_ID), MemoryIdempotentRepository.memoryIdempotentRepository())

It means that message is first downloaded from isds
and then eventually filtered out by idempotent consumer.

It's worth checking implementation of camel file component and support this direclty in consumer (and don't download message if we don't need to).
http://camel.apache.org/file2.html