Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 使用嵌入式ActiveMQ Artemis JMS服务器进行Spring引导_Java_Spring Boot_Activemq Artemis - Fatal编程技术网

Java 使用嵌入式ActiveMQ Artemis JMS服务器进行Spring引导

Java 使用嵌入式ActiveMQ Artemis JMS服务器进行Spring引导,java,spring-boot,activemq-artemis,Java,Spring Boot,Activemq Artemis,我正在使用下面的代码定制嵌入式ActiveMQ Artemis服务器 @覆盖 public void定制(org.apache.activemq.artemis.core.config.Configuration) 它工作正常,我发现我以后可以像这样访问-> Queue Queue=embeddedActiveMQ.getActiveMQServer().locateQueue(“队列”); QueueControl QueueControl=新的QueueControlImpl(队列, qu

我正在使用下面的代码定制嵌入式ActiveMQ Artemis服务器

@覆盖
public void定制(org.apache.activemq.artemis.core.config.Configuration)
它工作正常,我发现我以后可以像这样访问->

Queue Queue=embeddedActiveMQ.getActiveMQServer().locateQueue(“队列”);
QueueControl QueueControl=新的QueueControlImpl(队列,
queue.getAddress().toString()、embeddedActiveMQ.getActiveMQServer()、embeddedActiveMQ.getActiveMQServer().getStorageManager()、embeddedActiveMQ.getActiveMQServer().getSecurityStore()、embeddedActiveMQ.getActiveMQServer().getAddressSettingsRepository());
queueControl.browse();
这样做有问题吗


我正在尝试编写一个自定义端点来处理队列管理,而不是使用Jolokia的经典包。

从技术上讲,这样做并没有什么问题,但可能有更好的方法来完成您想要的任务。例如,要获取
QueueControl
实例,可以执行以下操作:

QueueControl-QueueControl=embeddedActiveMQ.getActiveMQServer().getManagementService().getResource(ResourceNames.QUEUE+“队列”);

这将获得已为队列创建的
QueueControl
,而不是从头创建一个新的队列。

请参阅编辑的postYes!多谢各位