Search in sources :

Example 1 with ScheduleUpdateMessage

use of org.atlasapi.messaging.v3.ScheduleUpdateMessage in project atlas-persistence by atlasapi.

the class MongoScheduleStore method sendUpdateMessage.

private void sendUpdateMessage(Publisher publisher, Channel channel, Interval interval) {
    String mid = UUID.randomUUID().toString();
    Timestamp ts = timestamper.timestamp();
    String src = publisher.key();
    String cid = idCodec.encode(BigInteger.valueOf(channel.getId()));
    DateTime start = interval.getStart();
    DateTime end = interval.getEnd();
    ScheduleUpdateMessage msg = new ScheduleUpdateMessage(mid, ts, src, cid, start, end);
    try {
        messageSender.sendMessage(msg, msg.getChannel().getBytes());
    } catch (MessagingException e) {
        String errMsg = String.format("%s %s %s", src, cid, interval);
        log.error(errMsg, e);
    }
}
Also used : MessagingException(com.metabroadcast.common.queue.MessagingException) Timestamp(com.metabroadcast.common.time.Timestamp) DateTime(org.joda.time.DateTime) ScheduleUpdateMessage(org.atlasapi.messaging.v3.ScheduleUpdateMessage)

Aggregations

MessagingException (com.metabroadcast.common.queue.MessagingException)1 Timestamp (com.metabroadcast.common.time.Timestamp)1 ScheduleUpdateMessage (org.atlasapi.messaging.v3.ScheduleUpdateMessage)1 DateTime (org.joda.time.DateTime)1