@PUT(value = "/todo/", code = 202)
    public Todo get() {
        if (!consumeQueue.isPresent()) {
            initConsumeQueue();
        }

        Todo todo;

        try {
            todo = consumeQueue.get().poll();
        } catch (JmsException ex) {
            queue = Optional.empty();
            consumeQueue = Optional.empty();
            initConsumeQueue();
            todo = consumeQueue.get().poll();
        }
        return todo;
    }
@PUT(value = "/todo/", code = 202)
    public Todo get() {
        if (!consumeQueue.isPresent()) {
            initConsumeQueue();
        }

        Todo todo;

        try {
            todo = consumeQueue.get().poll();
        } catch (JmsException ex) {
            queue = Optional.empty();
            consumeQueue = Optional.empty();
            initConsumeQueue();
            todo = consumeQueue.get().poll();
        }
        return todo;
    }
@ PUT ( value = "/todo/" , code = 202 ) public Todo get ( ) { if ( ! consumeQueue . isPresent ( ) ) { initConsumeQueue ( ) ; } Todo todo ; try { todo = consumeQueue . get ( ) . poll ( ) ; } catch ( JmsException ex ) { queue = Optional . empty ( ) ; consumeQueue = Optional . empty ( ) ; initConsumeQueue ( ) ; todo = consumeQueue . get ( ) . poll ( ) ; } return todo ; }
curl -X PUT http://localhost:9090/jms/todo/
@return true or throws an exception
curl - X PUT http : // localhost : 9090 / jms / todo /