package click.kamil.ultimate.messaging;

import lombok.RequiredArgsConstructor;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.statemachine.StateMachine;
import org.springframework.stereotype.Component;

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

    @RabbitListener(queues = "ticket.escalate.exchange")
    public void onEscalate(String payload) {
        stateMachine.sendEvent("ESCALATE");
    }
}
