Push notifications using rabbitmq

Viewed 3488

I want to send notifications to mobile application using rabbitmq, the problem is that i never used amqp protocol, so i need some advices

1) As i read from here http://www.rabbitmq.com/alarms.html if i send message all cosumers will get it, do i need to create separate queue for each user?

2)I want to send push using GCM only when mobile application is turn off, can i do it using this structure(spring boot)?

@Controller
public class SampleController {
    Logger logger = Logger.getLogger(SampleController.class);

   @Autowired
    RabbitTemplate template;

    @RequestMapping("/")
    @ResponseBody
    String home() {
        return "Empty mapping";
    }

    @RequestMapping("/process/{message}")
    @ResponseBody
    String error(@PathVariable("message") String message) {
        logger.info(String.format("Emit '%s'",message));
        String response = (String) template.convertSendAndReceive("query-example-2",message);
        logger.info(String.format("Received on producer '%s'",response));
        if(response==null) {
          sendPushViaGCM(message);
        }
        return String.valueOf("returned from worker : " + response);
    }

3) If mobile appliction is turn off and i send push using gcm how to delete message from rabbitmq queue to avoid double push when application is turn on

4)As i suggested, when client connect to my rabbitmq service all others will don't have permission to listen other queues until first one is not finished. Am i right? Some code examples will be grateful

0 Answers
Related