Add DMF message correlation-id to action history.
Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
@@ -58,6 +58,7 @@ public abstract class SenderService extends MessageService {
|
|||||||
}
|
}
|
||||||
message.getMessageProperties().getHeaders().remove(AbstractJavaTypeMapper.DEFAULT_CLASSID_FIELD_NAME);
|
message.getMessageProperties().getHeaders().remove(AbstractJavaTypeMapper.DEFAULT_CLASSID_FIELD_NAME);
|
||||||
final String correlationId = UUID.randomUUID().toString();
|
final String correlationId = UUID.randomUUID().toString();
|
||||||
|
message.getMessageProperties().setCorrelationId(correlationId.getBytes());
|
||||||
|
|
||||||
if (LOGGER.isTraceEnabled()) {
|
if (LOGGER.isTraceEnabled()) {
|
||||||
LOGGER.trace("Sending message {} to exchange {} with correlationId {}", message, address, correlationId);
|
LOGGER.trace("Sending message {} to exchange {} with correlationId {}", message, address, correlationId);
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ hawkbit.password=admin
|
|||||||
|
|
||||||
spring.main.show-banner=false
|
spring.main.show-banner=false
|
||||||
|
|
||||||
hawkbit.scenarios.[0].cleanRepository=true
|
hawkbit.scenarios.[0].cleanRepository=false
|
||||||
hawkbit.scenarios.[0].targets=0
|
hawkbit.scenarios.[0].targets=0
|
||||||
hawkbit.scenarios.[0].ds-name=gettingstarted-example
|
hawkbit.scenarios.[0].ds-name=gettingstarted-example
|
||||||
hawkbit.scenarios.[0].distribution-sets=3
|
hawkbit.scenarios.[0].distribution-sets=3
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ import org.springframework.security.core.context.SecurityContextHolder;
|
|||||||
import org.springframework.security.core.context.SecurityContextImpl;
|
import org.springframework.security.core.context.SecurityContextImpl;
|
||||||
import org.springframework.web.util.UriComponentsBuilder;
|
import org.springframework.web.util.UriComponentsBuilder;
|
||||||
|
|
||||||
import com.google.common.base.Strings;
|
|
||||||
import com.google.common.eventbus.EventBus;
|
import com.google.common.eventbus.EventBus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -348,9 +347,9 @@ public class AmqpMessageHandlerService extends BaseAmqpService {
|
|||||||
final ActionStatus actionStatus = entityFactory.generateActionStatus();
|
final ActionStatus actionStatus = entityFactory.generateActionStatus();
|
||||||
actionUpdateStatus.getMessage().forEach(actionStatus::addMessage);
|
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 "
|
actionStatus.addMessage(RepositoryConstants.SERVER_MESSAGE_PREFIX + "DMF message correlation-id "
|
||||||
+ message.getMessageProperties().getCorrelationIdString());
|
+ message.getMessageProperties().getCorrelationId());
|
||||||
}
|
}
|
||||||
|
|
||||||
actionStatus.setAction(action);
|
actionStatus.setAction(action);
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ public class DefaultAmqpSenderService implements AmqpSenderService {
|
|||||||
|
|
||||||
final String correlationId = UUID.randomUUID().toString();
|
final String correlationId = UUID.randomUUID().toString();
|
||||||
final String exchange = extractExchange(replyTo);
|
final String exchange = extractExchange(replyTo);
|
||||||
|
message.getMessageProperties().setCorrelationId(correlationId.getBytes());
|
||||||
|
|
||||||
if (LOGGER.isTraceEnabled()) {
|
if (LOGGER.isTraceEnabled()) {
|
||||||
LOGGER.trace("Sending message {} to exchange {} with correlationId {}", message, exchange, correlationId);
|
LOGGER.trace("Sending message {} to exchange {} with correlationId {}", message, exchange, correlationId);
|
||||||
|
|||||||
Reference in New Issue
Block a user