Fix DMF update cancel message (#397)
* Fix bug where DMF sends cancel for DDI targets. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Fix nullpointer when event consumer access target info. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
@@ -156,6 +156,10 @@ public class AmqpMessageDispatcherService extends BaseAmqpService {
|
||||
|
||||
void sendCancelMessageToTarget(final String tenant, final String controllerId, final Long actionId,
|
||||
final URI address) {
|
||||
if (!IpUtil.isAmqpUri(address)) {
|
||||
return;
|
||||
}
|
||||
|
||||
final Message message = getMessageConverter().toMessage(actionId,
|
||||
createConnectorMessageProperties(tenant, controllerId, EventTopic.CANCEL_DOWNLOAD));
|
||||
|
||||
|
||||
@@ -409,10 +409,15 @@ public class JpaDeploymentManagement implements DeploymentManagement {
|
||||
* the action id of the assignment
|
||||
*/
|
||||
private void cancelAssignDistributionSetEvent(final Target target, final Long actionId) {
|
||||
loadLazyTargetInfo(target);
|
||||
afterCommit.afterCommit(() -> eventPublisher
|
||||
.publishEvent(new CancelTargetAssignmentEvent(target, actionId, applicationContext.getId())));
|
||||
}
|
||||
|
||||
private static void loadLazyTargetInfo(final Target target) {
|
||||
target.getTargetInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Modifying
|
||||
@Transactional(isolation = Isolation.READ_COMMITTED)
|
||||
|
||||
Reference in New Issue
Block a user