backend/src/main/java/com/magamochi/content/queue/consumer/MangaContentImageIngestConsumer.java

23 lines
879 B
Java

package com.magamochi.content.queue.consumer;
import com.magamochi.common.queue.command.MangaContentImageIngestCommand;
import com.magamochi.content.service.ContentIngestService;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Service;
@Log4j2
@Service
@RequiredArgsConstructor
public class MangaContentImageIngestConsumer {
private final ContentIngestService contentIngestService;
@RabbitListener(queues = "${queues.manga-content-image-ingest}")
public void receiveMangaContentImageIngestCommand(MangaContentImageIngestCommand command) {
log.info("Received manga content ingest command: {}", command);
contentIngestService.ingestImages(
command.mangaContentId(), command.url(), command.position(), command.isLast());
}
}