使用jms时没有托管连接

问题描述 投票:0回答:1

我正在使用wildfly jms队列...我正在使用wildfly 9.0.2.Final

我让制作人像这样:

@Inject
private JMSContext jmsContext;
private JMSProducer jmsProducer;    

@Resource(mappedName = "java:/jboss/exported/jms/queue/TosDownloadReport")
private Queue queueDownloadReport;      

public void downloadReport(String adminId, DownloadReportFilter filter){
    try {
        jmsProducer = jmsContext.createProducer();
        String requestParam = Json.getInstance().getObjectMapper().writeValueAsString(filter);
        LOG.info("requestParam {}", requestParam);
        String id = UUID.randomUUID().toString().replace("-", "");
        RoutingRequest request = new RoutingRequest();
        request.putProperty("id", id);
        request.putProperty("adminId", adminId);
        request.putProperty("parameterRequest", requestParam);

        QueueMsgDownloadReport message = new QueueMsgDownloadReport();
        message.setId(id);
        message.setAdminId(adminId);

        String jsonMsg = Json.getInstance().getObjectMapper().writeValueAsString(message);

        gatewayService.send(RESOURCE, METHOD, request);
        jmsProducer.send(queueDownloadReport, jsonMsg);
    } catch (Exception e) {
        LOG.error(e.getMessage(),e);
    }
}

但有时我得到这样的异常,我必须重新启动wildfly

2017-05-05 11:08:20,004 ERROR [com.daksa.tos.infrastructure.api.TosTimer] (EJB default - 7) Could not create a session: IJ000453: Unable to get managed connection for java:/JmsXA: javax.jms.JMSRuntimeException: Could not create a session: IJ000453: Unable to get managed connection for java:/JmsXA
Caused by: javax.resource.ResourceException: IJ000655: No managed connections available within configured blocking timeout (30000 [ms])

从我读到的,我不需要调用jmsContext.close()如果我正在使用注入权?

请告诉我我做错了什么......谢谢

jms wildfly
1个回答
0
投票

这个问题解决了吗?我在JBoss EAP 7.1上也面临着同样的错误,批处理作业使用类似的结构调用服务来发送JMS消息(通过CDI注入的JMS资源)。

javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/RemoteJmsXA
...
javax.resource.ResourceException: IJ000655: No managed connections available within configured blocking timeout (30000 [ms])

在多次出现上述错误后,批处理作业以与事务超时相关的错误结束:

"WFTXN0001: A transaction is already in progress" failure for JBeret batch after transaction timeout in JBoss EAP
© www.soinside.com 2019 - 2024. All rights reserved.