Add DMF message correlation-id to action history.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
kaizimmerm
2016-06-22 09:17:35 +02:00
parent 3557a58bd9
commit 3d049fada1
4 changed files with 5 additions and 4 deletions

View File

@@ -58,6 +58,7 @@ public abstract class SenderService extends MessageService {
}
message.getMessageProperties().getHeaders().remove(AbstractJavaTypeMapper.DEFAULT_CLASSID_FIELD_NAME);
final String correlationId = UUID.randomUUID().toString();
message.getMessageProperties().setCorrelationId(correlationId.getBytes());
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Sending message {} to exchange {} with correlationId {}", message, address, correlationId);

View File

@@ -13,7 +13,7 @@ hawkbit.password=admin
spring.main.show-banner=false
hawkbit.scenarios.[0].cleanRepository=true
hawkbit.scenarios.[0].cleanRepository=false
hawkbit.scenarios.[0].targets=0
hawkbit.scenarios.[0].ds-name=gettingstarted-example
hawkbit.scenarios.[0].distribution-sets=3

View File

@@ -70,7 +70,6 @@ import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.context.SecurityContextImpl;
import org.springframework.web.util.UriComponentsBuilder;
import com.google.common.base.Strings;
import com.google.common.eventbus.EventBus;
/**
@@ -348,9 +347,9 @@ public class AmqpMessageHandlerService extends BaseAmqpService {
final ActionStatus actionStatus = entityFactory.generateActionStatus();
actionUpdateStatus.getMessage().forEach(actionStatus::addMessage);
if (!Strings.isNullOrEmpty(message.getMessageProperties().getCorrelationIdString())) {
if (message.getMessageProperties().getCorrelationId().length > 0) {
actionStatus.addMessage(RepositoryConstants.SERVER_MESSAGE_PREFIX + "DMF message correlation-id "
+ message.getMessageProperties().getCorrelationIdString());
+ message.getMessageProperties().getCorrelationId());
}
actionStatus.setAction(action);

View File

@@ -46,6 +46,7 @@ public class DefaultAmqpSenderService implements AmqpSenderService {
final String correlationId = UUID.randomUUID().toString();
final String exchange = extractExchange(replyTo);
message.getMessageProperties().setCorrelationId(correlationId.getBytes());
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Sending message {} to exchange {} with correlationId {}", message, exchange, correlationId);