Search in sources :

Example 1 with EtcdKeyPutRequest

use of mousio.etcd4j.requests.EtcdKeyPutRequest in project camel by apache.

the class EtcdKeysProducer method processSet.

// *************************************************************************
// Processors
// *************************************************************************
private void processSet(EtcdClient client, String path, Exchange exchange) throws Exception {
    EtcdKeyPutRequest request = client.put(path, exchange.getIn().getBody(String.class));
    setRequestTimeToLive(request, exchange);
    setRequestTimeout(request, exchange);
    try {
        exchange.getIn().setHeader(EtcdConstants.ETCD_NAMESPACE, getNamespace());
        exchange.getIn().setBody(request.send().get());
    } catch (TimeoutException e) {
        throw new ExchangeTimedOutException(exchange, configuration.getTimeout());
    }
}
Also used : EtcdKeyPutRequest(mousio.etcd4j.requests.EtcdKeyPutRequest) ExchangeTimedOutException(org.apache.camel.ExchangeTimedOutException) TimeoutException(java.util.concurrent.TimeoutException)

Aggregations

TimeoutException (java.util.concurrent.TimeoutException)1 EtcdKeyPutRequest (mousio.etcd4j.requests.EtcdKeyPutRequest)1 ExchangeTimedOutException (org.apache.camel.ExchangeTimedOutException)1