camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From teikitel <loic.teikiteetini.vay...@gmail.com>
Subject JPA consumer component is not handling multiple server concurrent polling
Date Wed, 19 Apr 2017 17:03:00 GMT
Hi,

I am running the same Camel application on four different servers and JPA
camel component is not properly managing exclusive locks on polled rows.
This is how we configured our route :

@Override
    public void configure() throws Exception {
        // @formatter:off
		from("jpa://Toto?lockModeType=PESSIMISTIC_READ"
		        + "&consumeDelete=false"
				+ "&consumeLockEntity=true"
				+ "&consumer.SkipLockedEntity=true"
				+ "&maximumResults=10"
				+ "&sharedEntityManager=true"
				+ "&joinTransaction=false"
				+ "&delay=200"
				+ "&consumer.query=select t from Toto t where t.consumed = 0")
		    .bean(totoAction, "consumeToto")
		    .process(exchange-> System.out.println(exchange.getIn().getBody()));
		// @formatter:on
    }

Inserting 20 rows at the same time while 2 servers are running the app
causes some entities to be processed by both servers.

Do you know a nice work around to fix my problem ?

I can easily share you my sources if you need to reproduce it.

Thanks for this great framework,

Loic



--
View this message in context: http://camel.465427.n5.nabble.com/JPA-consumer-component-is-not-handling-multiple-server-concurrent-polling-tp5797937.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message