问题描述
是否有某种方法可以回滚执行到RabbitListener事件中的事务?我有类似下面的内容
export class CustomComponentOne extends Component2 implements OnDestroy {
constructor(router: Router,renderer: Renderer2,elemRef: ElementRef,protected somelogoutService: logoutService) {
super(router,renderer,elemRef);
}
ngOnDestroy(): void {
super.ngOnDestroy();
}
testMethod(): void {
this.somelogoutService.performCustomlogout().subscribe((response) => {
if (response.status === 200) {
localStorage.clear()
}
});
}
productcomponent
export class changeProductComponent extends productcomponent implements OnInit {
protected authService: AuthenticationService;
constructor(authService: AuthenticationService,userService: UserService) {
super(authService,userService);
this.authService = AuthenticationService;
}
ngOnInit(): void {
super.ngOnInit();
}
methodToCall(): string {
return this.customLoginAdapter.getCustomLoginUrl();
}
producntcomponent.htm
<p ngIf="methodToCall()">testprod</p>
我尝试使用Transactional,但是即使消息@Autowired private SomeService service;
@RabbitListener(queues = {"some-queue-ttl-5s"})
@Transactional
public SomeOutputMessage handleMessageQueue(SomeInputMessage inputMessage){
//do something
return service.processInput(inputMessage); //JPA update transaction
}
过期后,x-message-ttl
也会提交事务。我想知道我们是否可以回滚该过程并将inputMessage发送到dlx。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)