galovics commented on code in PR #2330:
URL: https://github.com/apache/fineract/pull/2330#discussion_r876998243
##########
fineract-provider/src/main/java/org/apache/fineract/notification/eventandlistener/ActiveMQNotificationEventPublisher.java:
##########
@@ -18,33 +18,24 @@
*/
package org.apache.fineract.notification.eventandlistener;
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.Session;
+import javax.jms.Queue;
+import lombok.RequiredArgsConstructor;
+import org.apache.activemq.command.ActiveMQQueue;
import org.apache.fineract.notification.data.NotificationData;
-import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Profile;
import org.springframework.jms.core.JmsTemplate;
-import org.springframework.jms.core.MessageCreator;
import org.springframework.stereotype.Service;
@Service
-public class NotificationEventService {
+@Profile("activeMqEnabled")
+@RequiredArgsConstructor
+public class ActiveMQNotificationEventPublisher implements
NotificationEventPublisher {
private final JmsTemplate jmsTemplate;
- @Autowired
- public NotificationEventService(JmsTemplate jmsTemplate) {
- this.jmsTemplate = jmsTemplate;
- }
-
- public void broadcastNotification(final Destination destination, final
NotificationData notificationData) {
- this.jmsTemplate.send(destination, new MessageCreator() {
-
- @Override
- public Message createMessage(Session session) throws JMSException {
- return session.createObjectMessage(notificationData);
- }
- });
+ @Override
+ public void broadcastNotification(NotificationData notificationData) {
+ Queue queue = new ActiveMQQueue("NotificationQueue");
Review Comment:
You're not wrong there but I intentionally left it here since this was the
original implementation and I didn't want to spend more time on testing the
ActiveMQ piece as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]