public void setIdAndTimestamp() { if (!isMutable()) { return; } if (getId() == null) { IdGenerator idGenerator = (MessageHeaderAccessor.this.idGenerator != null ? MessageHeaderAccessor.this.idGenerator : MessageHeaders.getIdGenerator()); UUID id = idGenerator.generateId(); if (id != null && id != MessageHeaders.ID_VALUE_NONE) { getRawHeaders().put(ID, id); } } if (getTimestamp() == null) { if (MessageHeaderAccessor.this.enableTimestamp) { getRawHeaders().put(TIMESTAMP, System.currentTimeMillis()); } } }
/** * Return a unique random name for stream/task testing. * * @param name name to use as part of stream/task name * @return unique random stream/task name */ protected String generateUniqueName(String name) { return name + "-" + idGenerator.generateId(); }