AMQ-7002 - Change jobid identifier to messageid format

This commit is contained in:
Jeff Genender 2018-06-27 10:29:40 -06:00
parent 4cbb913271
commit 3397a97213
1 changed files with 5 additions and 2 deletions

View File

@ -55,6 +55,7 @@ import org.slf4j.LoggerFactory;
public class SchedulerBroker extends BrokerFilter implements JobListener { public class SchedulerBroker extends BrokerFilter implements JobListener {
private static final Logger LOG = LoggerFactory.getLogger(SchedulerBroker.class); private static final Logger LOG = LoggerFactory.getLogger(SchedulerBroker.class);
private static final IdGenerator ID_GENERATOR = new IdGenerator(); private static final IdGenerator ID_GENERATOR = new IdGenerator();
private static final LongSequenceGenerator longGenerator = new LongSequenceGenerator();
private final LongSequenceGenerator messageIdGenerator = new LongSequenceGenerator(); private final LongSequenceGenerator messageIdGenerator = new LongSequenceGenerator();
private final AtomicBoolean started = new AtomicBoolean(); private final AtomicBoolean started = new AtomicBoolean();
private final WireFormat wireFormat = new OpenWireFormat(); private final WireFormat wireFormat = new OpenWireFormat();
@ -337,8 +338,10 @@ public class SchedulerBroker extends BrokerFilter implements JobListener {
repeat = (Integer) TypeConversionSupport.convert(repeatValue, Integer.class); repeat = (Integer) TypeConversionSupport.convert(repeatValue, Integer.class);
} }
String jobId = ID_GENERATOR.generateId(); //job id should be unique for every job (Same format as MessageId)
getInternalScheduler().schedule(jobId, MessageId jobId = new MessageId(messageSend.getMessageId().getProducerId(), longGenerator.getNextSequenceId());
getInternalScheduler().schedule(jobId.toString(),
new ByteSequence(packet.data, packet.offset, packet.length), cronEntry, delay, period, repeat); new ByteSequence(packet.data, packet.offset, packet.length), cronEntry, delay, period, repeat);
} }