Using SQL Server as an imitation Queue with Camel
SQL Server's lock hints allow to you to use it as a database queue. The general process is discussed on stackoverflow . Here I wanted to summarise the different ways it can be configured with the camel-jpa component. Testing was done against SQL Server 2008 R2 Developer Edition. The list of locks was obtained using this useful script from Microsoft . Assume we have a generic entity: @Entity public class JpaMessage { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; /** an optional hint as to type of message */ private String msgType; /** a refrence to another table containing the blob for performance reasons */ private Long msgBlobId; /** to allow for PESSIMISTIC locking */ @Version private Date lastUpdated; } /** basic route */ public class TestRoutbuiler extends BaseRouteBuilder { @Value("${endpoint.uri}") private String endpointUri; @Override public void configure() throws Exception { ...