调用http组件时骆驼线程ID发生变化
Camel Thread Id changing when calling http component
我的路线是这样的:
from(rabbitmq).
to(redisLockerProcessor).
to(processor1).
to(ahc://http:).to(processor2)
.to(redisLockReleaseProcessor)
我正在使用 redisson 库,它存储在 redis 中获取锁的线程 ID。但是在 redisLockReleaseProcessor
中它抛出异常 thread id is not same as thread id which took the lock
。 http组件线程如何在骆驼中工作?我虽然整个路线 运行s 在同一个线程中。如果整个路由不在同一个线程中,我们如何解决这里的 redis 问题?
camel-ahc 组件正在使用非阻塞调用,因此您的 camel 路由中的线程可能会发生变化。您可以考虑将线程ID存储为交换属性(您可以使用它来释放redisLockReleaseProcessor中的redisLock)或使用其他camel http组件,例如使用块API发送的camel-http请求。
我的路线是这样的:
from(rabbitmq).
to(redisLockerProcessor).
to(processor1).
to(ahc://http:).to(processor2)
.to(redisLockReleaseProcessor)
我正在使用 redisson 库,它存储在 redis 中获取锁的线程 ID。但是在 redisLockReleaseProcessor
中它抛出异常 thread id is not same as thread id which took the lock
。 http组件线程如何在骆驼中工作?我虽然整个路线 运行s 在同一个线程中。如果整个路由不在同一个线程中,我们如何解决这里的 redis 问题?
camel-ahc 组件正在使用非阻塞调用,因此您的 camel 路由中的线程可能会发生变化。您可以考虑将线程ID存储为交换属性(您可以使用它来释放redisLockReleaseProcessor中的redisLock)或使用其他camel http组件,例如使用块API发送的camel-http请求。