Java:如何从 Spring 的 DMLC 取消订阅持久订阅者? [英] Java: how to unsubscribe a durable subscriber from Spring's DMLC?

查看:54
本文介绍了Java:如何从 Spring 的 DMLC 取消订阅持久订阅者?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在普通的 JMS 中,我们可以这样做: session.unsubscribe("持久订阅的名称");但我们如何通过 DMLC 做到这一点?在其中找不到用于此目的的任何特定方法.

In plain JMS we can do: session.unsubscribe("name of the durable subscription"); but how do we do it through DMLC? Couldn't find any specific method for this purpose in it.

推荐答案

据我所知,没有 Spring 特定的方式向 MQ 服务器发送取消订阅"命令,但是您始终可以选择获取底层 JMS通过扩展 DefaultMessageListenerContainer 类并调用 getSession()createSession().毕竟 Spring 只是 JMS 之上的一个方便的抽象,并不会阻止您在需要时直接使用 JMS API.

To my knowledge, there is no Spring specific way of sending an "unsubscribe" command to the MQ server, however you always have the option of obtaining an underlying JMS Session by extending the DefaultMessageListenerContainer class and calling getSession() or createSession(). After all Spring is just a convenient abstraction over the top of JMS and doesn't prevent you from using the JMS API directly if required.

这篇关于Java:如何从 Spring 的 DMLC 取消订阅持久订阅者?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆