package click.kamil.ultimate.messaging;

import io.awspring.cloud.sqs.annotation.SqsListener;
import lombok.RequiredArgsConstructor;
import org.springframework.statemachine.StateMachine;
import org.springframework.stereotype.Component;

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

    @SqsListener("ticket-updates-queue")
    public void onUpdate(String message) {
        stateMachine.sendEvent("SQS_UPDATE");
    }
}
