-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0a4b22e
commit 3b3fd70
Showing
2 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...java/com/gt/genti/picturegeneraterequest/service/PictureGenerateFailedEventPublisher.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.gt.genti.picturegeneraterequest.service; | ||
|
||
import org.springframework.context.ApplicationEventPublisher; | ||
import org.springframework.scheduling.annotation.Async; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Propagation; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
import com.gt.genti.firebase.event.PictureGenerationFailedNotificationEvent; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
public class PictureGenerateFailedEventPublisher { | ||
|
||
private final ApplicationEventPublisher eventPublisher; | ||
|
||
@Async | ||
@Transactional(propagation = Propagation.REQUIRES_NEW) | ||
public void publishPictureGenerateFailedEvent(Long receiverId) { | ||
eventPublisher.publishEvent(PictureGenerationFailedNotificationEvent.of(receiverId)); | ||
} | ||
|
||
} | ||
|