配置MDB以侦听多个队列 [英] Configuring an MDB to listen to multiple queues

查看:80
本文介绍了配置MDB以侦听多个队列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用EJB 3.1,我想配置一个MDB来监听多个队列。

我更喜欢通过XML定义队列名称,而不是通过注释定义其他定义。

可以这样做吗?

I'm using EJB 3.1 and I want to configure an MDB to listen to multiple queues.
I'd prefer defining the queue names via XML but the other definitions via annotations.
Can this be done?

推荐答案

一旦实例化,MDB只能监听目标ActivationConfigProperty中指定的资源,但是你可以创建具有不同目的地的同一个MDB的多个实例(在你的情况下是队列)。

Once instantiated, an MDB can only listen to the resource specified in their destination ActivationConfigProperty, however you can create multiple instances of the same MDB with different destinations (queues, in your case).

在你的ejb-中创建两个条目jar.xml具有不同的目标和ejb-name属性,但是相同的ejb-class。

Create two entries in your ejb-jar.xml with different destination and ejb-name properties, but the same ejb-class.

这篇关于配置MDB以侦听多个队列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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