Fix scheduled executor, auth exchange and simulator poll.
Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
@@ -99,7 +99,8 @@ public class DeviceSimulatorUpdater {
|
||||
|
||||
// plug and play - non existing device will be auto created
|
||||
if (device == null) {
|
||||
device = repository.add(deviceFactory.createSimulatedDevice(id, tenant, Protocol.DMF_AMQP, -1, null, null));
|
||||
device = repository
|
||||
.add(deviceFactory.createSimulatedDevice(id, tenant, Protocol.DMF_AMQP, 1800, null, null));
|
||||
}
|
||||
|
||||
device.setProgress(0.0);
|
||||
|
||||
@@ -45,7 +45,7 @@ public class SimulatedDeviceFactory {
|
||||
*/
|
||||
public AbstractSimulatedDevice createSimulatedDevice(final String id, final String tenant,
|
||||
final Protocol protocol) {
|
||||
return createSimulatedDevice(id, tenant, protocol, 30, null, null);
|
||||
return createSimulatedDevice(id, tenant, protocol, 1800, null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -86,10 +86,6 @@ public class SimulationController {
|
||||
final String deviceId = name + i;
|
||||
repository.add(deviceFactory.createSimulatedDevice(deviceId, tenant, protocol, pollDelay, new URL(endpoint),
|
||||
gatewayToken));
|
||||
|
||||
if (protocol == Protocol.DMF_AMQP) {
|
||||
spSenderService.createOrUpdateThing(tenant, deviceId);
|
||||
}
|
||||
}
|
||||
|
||||
return ResponseEntity.ok("Updated " + amount + " DMF connected targets!");
|
||||
|
||||
@@ -11,7 +11,6 @@ package org.eclipse.hawkbit.simulator;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
import org.eclipse.hawkbit.simulator.AbstractSimulatedDevice.Protocol;
|
||||
import org.eclipse.hawkbit.simulator.amqp.SpSenderService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -54,10 +53,6 @@ public class SimulatorStartup implements ApplicationListener<ContextRefreshedEve
|
||||
} catch (final MalformedURLException e) {
|
||||
LOGGER.error("Creation of simulated device at startup failed.", e);
|
||||
}
|
||||
|
||||
if (autostart.getApi() == Protocol.DMF_AMQP) {
|
||||
spSenderService.createOrUpdateThing(autostart.getTenant(), deviceId);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -122,8 +122,8 @@ public class AmqpConfiguration {
|
||||
final Map<String, Object> arguments = getDeadLetterExchangeArgs();
|
||||
arguments.putAll(getTTLMaxArgs());
|
||||
|
||||
return QueueBuilder.nonDurable(amqpProperties.getReceiverConnectorQueueFromSp()).withArguments(arguments)
|
||||
.build();
|
||||
return QueueBuilder.nonDurable(amqpProperties.getReceiverConnectorQueueFromSp()).autoDelete()
|
||||
.withArguments(arguments).build();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -133,12 +133,12 @@ public class AmqpConfiguration {
|
||||
*/
|
||||
@Bean
|
||||
public FanoutExchange exchangeQueueToConnector() {
|
||||
return new FanoutExchange(amqpProperties.getSenderForSpExchange());
|
||||
return new FanoutExchange(amqpProperties.getSenderForSpExchange(), false, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the Binding
|
||||
* {@link AmqpConfiguration#receiverConnectorQueueFromSp()} to
|
||||
* {@link AmqpConfiguration#receiverConnectorQueueFromHawkBit()} to
|
||||
* {@link AmqpConfiguration#exchangeQueueToConnector()}.
|
||||
*
|
||||
* @return the binding and create the queue and exchange
|
||||
@@ -165,7 +165,7 @@ public class AmqpConfiguration {
|
||||
*/
|
||||
@Bean
|
||||
public FanoutExchange exchangeDeadLetter() {
|
||||
return new FanoutExchange(amqpProperties.getDeadLetterExchange());
|
||||
return new FanoutExchange(amqpProperties.getDeadLetterExchange(), false, true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user