use of org.apache.camel.component.ignite.idgen.IgniteIdGenEndpoint in project camel by apache.
the class IgniteComponent method createEndpoint.
@Override
protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
ObjectHelper.notNull(getCamelContext(), "Camel Context");
AbstractIgniteEndpoint answer = null;
URI remainingUri = new URI(URISupport.normalizeUri(remaining));
String scheme = remainingUri.getScheme();
switch(scheme) {
case "cache":
answer = new IgniteCacheEndpoint(uri, remainingUri, parameters, this);
break;
case "compute":
answer = new IgniteComputeEndpoint(uri, remainingUri, parameters, this);
break;
case "messaging":
answer = new IgniteMessagingEndpoint(uri, remainingUri, parameters, this);
break;
case "events":
answer = new IgniteEventsEndpoint(uri, remainingUri, parameters, this);
break;
case "set":
answer = new IgniteSetEndpoint(uri, remainingUri, parameters, this);
break;
case "idgen":
answer = new IgniteIdGenEndpoint(uri, remainingUri, parameters, this);
break;
case "queue":
answer = new IgniteQueueEndpoint(uri, remainingUri, parameters, this);
break;
default:
throw new MalformedURLException("An invalid Ignite endpoint URI was provided. Please check that " + "it starts with:" + " ignite:[cache/compute/messaging/...]:...");
}
setProperties(answer, parameters);
return answer;
}
use of org.apache.camel.component.ignite.idgen.IgniteIdGenEndpoint in project camel by apache.
the class IgniteIdGenTest method testBatchSize.
@Test
public void testBatchSize() {
IgniteIdGenEndpoint endpoint = context.getEndpoint("ignite:idgen:abc?operation=GET&initialValue=100&batchSize=100", IgniteIdGenEndpoint.class);
assert_().that(template.requestBody(endpoint, null, Long.class)).isEqualTo(100);
// Cannot test much here with a single Ignite instance, let's just test that the parameter could be set.
assert_().that(endpoint.getBatchSize());
}
Aggregations