package click.kamil.ultimate.messaging;

import lombok.RequiredArgsConstructor;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.statemachine.StateMachine;
import org.springframework.stereotype.Component;

@Component
@RequiredArgsConstructor
public class JmsTicketListener {
    private final StateMachine<String, String> stateMachine;

    @JmsListener(destination = "ticket.close.queue")
    public void onCloseMessage(String ticketId) {
        stateMachine.sendEvent("CLOSE_TICKET");
    }
}
