@PUT(value = "/todo/", code = 202)
    public boolean send(final Todo todo) {
        if (!sendQueue.isPresent()) {
            initSendQueue();
        }
        try {
            sendQueue.ifPresent(todoSendQueue -> todoSendQueue.send(todo));
        } catch (JmsException ex) {
            queue = Optional.empty();
            sendQueue = Optional.empty();
            initSendQueue();
            sendQueue.ifPresent(todoSendQueue -> todoSendQueue.send(todo));
        }
        return true;
    }
@PUT(value = "/todo/", code = 202)
    public boolean send(final Todo todo) {
        if (!sendQueue.isPresent()) {
            initSendQueue();
        }
        try {
            sendQueue.ifPresent(todoSendQueue -> todoSendQueue.send(todo));
        } catch (JmsException ex) {
            queue = Optional.empty();
            sendQueue = Optional.empty();
            initSendQueue();
            sendQueue.ifPresent(todoSendQueue -> todoSendQueue.send(todo));
        }
        return true;
    }
@ PUT ( value = "/todo/" , code = 202 ) public boolean send ( final Todo todo ) { if ( ! sendQueue . isPresent ( ) ) { initSendQueue ( ) ; } try { sendQueue . ifPresent ( todoSendQueue -> todoSendQueue . send ( todo ) ) ; } catch ( JmsException ex ) { queue = Optional . empty ( ) ; sendQueue = Optional . empty ( ) ; initSendQueue ( ) ; sendQueue . ifPresent ( todoSendQueue -> todoSendQueue . send ( todo ) ) ; } return true ; }
curl -X PUT -H "Content-Type: application/json" -d '{"name":"deploy app", "done":true}' http://localhost:8080/jms/todo/
@param todo todo object
@return true or throws an exception
curl - X PUT - H Content - Type : application / json - d { name : deploy app done : true } http : // localhost : 8080 / jms / todo /