package ai.decompile.job.messaging;

import java.util.UUID;
import lombok.RequiredArgsConstructor;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
@RequiredArgsConstructor
public class JobMessagePublisher {
  private final RabbitTemplate rabbitTemplate;

  @Value("${app.rabbitmq.exchange}")
  private String exchange;

  @Value("${app.rabbitmq.routing-key}")
  private String routingKey;

  public void publish(UUID jobId) {
    rabbitTemplate.convertAndSend(exchange, routingKey, jobId.toString());
  }
}
