private String createCandidateName() { StringBuilder builder = new StringBuilder(); try { /* UUID would be enough, also using hostname for human readability */ builder.append(InetAddress.getLocalHost().getCanonicalHostName()); } catch (UnknownHostException ex) { LOG.warn("Failed to get the local hostname.", ex); builder.append("unknown-host"); } builder.append("-").append(uuidGenerator.generateUuid()); return builder.toString(); }
private String createCandidateName() { StringBuilder builder = new StringBuilder(); try { /* UUID would be enough, also using hostname for human readability */ builder.append(InetAddress.getLocalHost().getCanonicalHostName()); } catch (UnknownHostException ex) { LOG.warn("Failed to get the local hostname.", ex); builder.append("unknown-host"); } builder.append("-").append(uuidGenerator.generateUuid()); return builder.toString(); }
private String createCandidateName() { StringBuilder builder = new StringBuilder(); try { /* UUID would be enough, also using hostname for human readability */ builder.append(InetAddress.getLocalHost().getCanonicalHostName()); } catch (UnknownHostException ex) { LOG.warn("Failed to get the local hostname.", ex); builder.append("unknown-host"); } builder.append("-").append(uuidGenerator.generateUuid()); return builder.toString(); }
@Override public Publisher<Exchange> to(String uri, Object data) { requestedUriToStream.computeIfAbsent(uri, u -> { try { String uuid = context.getUuidGenerator().generateUuid(); new RouteBuilder() { @Override public void configure() throws Exception { from("reactive-streams:" + uuid) .to(u); } }.addRoutesToCamelContext(context); return uuid; } catch (Exception e) { throw new IllegalStateException("Unable to create requested reactive stream from direct URI: " + uri, e); } }); return toStream(requestedUriToStream.get(uri), data); }
private ServiceDefinition computeServiceDefinition(CamelContext context, Endpoint delegateEndpoint) { Map<String, String> parameters = new HashMap<>(); if (delegateEndpoint instanceof DiscoverableService) { parameters.putAll(((DiscoverableService)delegateEndpoint).getServiceProperties()); } parameters.putAll(serviceParameters); parameters.computeIfAbsent(ServiceDefinition.SERVICE_META_ID, k -> context.getUuidGenerator().generateUuid()); return DefaultServiceDefinition.builder().from(parameters).build(); } }
private StringBuilder newFileName() { StringBuilder actualPath = new StringBuilder(hdfsPath); actualPath.append(StringHelper.sanitize(getEndpoint().getCamelContext().getUuidGenerator().generateUuid())); return actualPath; }
@Override public Publisher<Exchange> from(String uri) { publishedUriToStream.computeIfAbsent(uri, u -> { try { String uuid = context.getUuidGenerator().generateUuid(); new RouteBuilder() { @Override public void configure() throws Exception { from(u) .to("reactive-streams:" + uuid); } }.addRoutesToCamelContext(context); return uuid; } catch (Exception e) { throw new IllegalStateException("Unable to create source reactive stream from direct URI: " + uri, e); } }); return fromStream(publishedUriToStream.get(uri)); }
@Override public Publisher<Exchange> to(String uri, Object data) { String streamName = requestedUriToStream.computeIfAbsent(uri, camelUri -> { try { String uuid = context.getUuidGenerator().generateUuid(); context.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { from("reactive-streams:" + uuid) .to(camelUri); } }); return uuid; } catch (Exception e) { throw new IllegalStateException("Unable to create requested reactive stream from direct URI: " + uri, e); } }); return toStream(streamName, data); }
@Override public Publisher<Exchange> to(String uri, Object data) { String streamName = requestedUriToStream.computeIfAbsent(uri, camelUri -> { try { String uuid = context.getUuidGenerator().generateUuid(); context.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { from("reactive-streams:" + uuid) .to(camelUri); } }); return uuid; } catch (Exception e) { throw new IllegalStateException("Unable to create requested reactive stream from direct URI: " + uri, e); } }); return toStream(streamName, data); }
@Override public Publisher<Exchange> from(String uri) { final String name = publishedUriToStream.computeIfAbsent(uri, camelUri -> { try { String uuid = context.getUuidGenerator().generateUuid(); context.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { from(camelUri).to("reactive-streams:" + uuid); } }); return uuid; } catch (Exception e) { throw new IllegalStateException("Unable to create source reactive stream from direct URI: " + uri, e); } }); return fromStream(name); }
@Override public Subscriber<Exchange> subscriber(String uri) { try { String uuid = context.getUuidGenerator().generateUuid(); context.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { from("reactive-streams:" + uuid) .to(uri); } }); return streamSubscriber(uuid); } catch (Exception e) { throw new IllegalStateException("Unable to create source reactive stream towards direct URI: " + uri, e); } }
@Override public Subscriber<Exchange> subscriber(String uri) { try { String uuid = context.getUuidGenerator().generateUuid(); new RouteBuilder() { @Override public void configure() throws Exception { from("reactive-streams:" + uuid) .to(uri); } }.addRoutesToCamelContext(context); return streamSubscriber(uuid); } catch (Exception e) { throw new IllegalStateException("Unable to create source reactive stream towards direct URI: " + uri, e); } }
@Override public Publisher<Exchange> from(String uri) { final String name = publishedUriToStream.computeIfAbsent(uri, camelUri -> { try { String uuid = context.getUuidGenerator().generateUuid(); context.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { from(camelUri).to("reactive-streams:" + uuid); } }); return uuid; } catch (Exception e) { throw new IllegalStateException("Unable to create source reactive stream from direct URI: " + uri, e); } }); return fromStream(name); }
@Override public Subscriber<Exchange> subscriber(String uri) { try { String uuid = context.getUuidGenerator().generateUuid(); context.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { from("reactive-streams:" + uuid) .to(uri); } }); return streamSubscriber(uuid); } catch (Exception e) { throw new IllegalStateException("Unable to create source reactive stream towards direct URI: " + uri, e); } }
@Override public void notify(EventObject eventObject) throws Exception { if (eventObject instanceof AbstractExchangeEvent) { AbstractExchangeEvent aee = (AbstractExchangeEvent) eventObject; if (isEnabled(aee.getExchange())) { if (aee instanceof ExchangeSendingEvent) { aee.getExchange().getIn().setHeader("AuditCallId", aee.getExchange().getContext().getUuidGenerator().generateUuid()); } String json = toJson(aee); storage.store(type, System.currentTimeMillis(), json); } } }
@Override public void notify(EventObject eventObject) throws Exception { if (eventObject instanceof AbstractExchangeEvent) { AbstractExchangeEvent aee = (AbstractExchangeEvent) eventObject; if (isEnabled(aee.getExchange())) { if (aee instanceof ExchangeSendingEvent) { aee.getExchange().getIn().setHeader("AuditCallId", aee.getExchange().getContext().getUuidGenerator().generateUuid()); } String json = toJson(aee); if (getStorage() != null) { getStorage().store(type, System.currentTimeMillis(), json); } } } }
final String provisionalCorrelationId = msgIdAsCorrId ? getUuidGenerator().generateUuid() : null; MessageSentCallback messageSentCallback = null; if (msgIdAsCorrId) { if (generateFreshCorrId) { in.setHeader(correlationPropertyToUse, GENERATED_CORRELATION_ID_PREFIX + getUuidGenerator().generateUuid());
id = "trigger-" + getCamelContext().getUuidGenerator().generateUuid();
String correlationId = GENERATED_CORRELATION_ID_PREFIX + getEndpoint().getCamelContext().getUuidGenerator().generateUuid(); in.setHeader(RabbitMQConstants.CORRELATIONID, correlationId);
ae.getExchange().setProperty(AuditConstants.DISPATCH_ID, ae.getExchange().getContext().getUuidGenerator().generateUuid());