@Name("stockPriceChangeNotifier")
public class StockPriceChangeNotifier {
@In private TopicPublisher stockTickerPublisher;
@In private TopicSession topicSession;
public void publish(StockPrice price) {
try {
stockTickerPublisher.publish(topicSession
.createObjectMessage(price));
} catch (Exception ex) {
throw new RuntimeException(ex);
}
}
}
@Name("stockPriceChangeNotifier")
public class StockPriceChangeNotifier {
@In private TopicPublisher stockTickerPublisher;
@In private TopicSession topicSession;
public void publish(StockPrice price) {
try {
stockTickerPublisher.publish(topicSession
.createObjectMessage(price));
} catch (Exception ex) {
throw new RuntimeException(ex);
}
}
}
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
@Name("paymentDispatcher")
public class PaymentDispatcher {
@In private QueueSender paymentQueueSender;
@In private QueueSession queueSession;
public void publish(Payment payment) {
try {
paymentQueueSender.send(queueSession.createObjectMessage(payment));
} catch (Exception ex) {
throw new RuntimeException(ex);
}
}
}
@Name("paymentDispatcher")
public class PaymentDispatcher {
@In private QueueSender paymentQueueSender;
@In private QueueSession queueSession;
public void publish(Payment payment) {
try {
paymentQueueSender.send(queueSession.createObjectMessage(payment));
} catch (Exception ex) {
throw new RuntimeException(ex);
}
}
}
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow