Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Importing
- //import com.rabbitmq.client.Channel;
- //import com.gitrekt.quora.queue.MessageQueueConnection;
- //import com.google.gson.JsonObject;
- //Available Types are : new_follower,question_answered,question_starred,
- // answer_starred,new_message,new_post, discussion_invitation,question_invitation, poll_answered;\
- // In the case of discussion invitation you will add the property of
- // msg.addProperty("discussionId", <theDisccusionId>);
- // msg.addProperty("senderId", <theSenderId>);
- // In the case of Question invitation you will add the property of
- // msg.addProperty("questionId", <theDisccusionId>);
- // msg.addProperty("senderId", <theSenderId>);
- */
- try {
- Channel channel = MessageQueueConnection.getInstance().createChannel();
- JsonObject msg = new JsonObject();
- msg.addProperty("senderId",<UserIDHere>);
- msg.addProperty("type", <YourTypeIsHere>);
- channel.basicPublish("", "notification-v1-queue", null, msg.toString().getBytes());
- channel.close();
- } catch (Exception exception) {
- exception.printStackTrace();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement