使用wlst根据用户属性删除消息

时间:2018-09-05 05:21:29

标签: jms wlst

您好,我可以使用JMS消息ID删除队列中的JMS消息,但不能删除基于消息的用户属性,您可以在这里帮我吗

connect('xxxx','xxxx','xxxxx')
servers = domainRuntimeService.getServerRuntimes();
for server in servers:
        jmsRuntime = server.getJMSRuntime();
        jmsServers = jmsRuntime.getJMSServers();
        for jmsServer in jmsServers:
             destinations = jmsServer.getDestinations();
             for destination in destinations:
                 desname=destination.getName()
                 MessagesCurrentCount=destination.getMessagesCurrentCount()
                 if MessagesCurrentCount == 0:
                         if desname == "QUEUE_RESPONSE":
#                            print 'Message Current Count  '+ str(MessagesCurrentCount) +' '
#                                        destination.deleteMessages("JMSMessageID IN('ID:<786419.1533793370330.0>')")
                                         selector = "ORDER_PRIMARY_KEY like 'jack%'";
                                          timeout = 0;
                                          destination.getMessages(selector,timeout);
                                          destination.deleteMessages("selector")

1 个答案:

答案 0 :(得分:0)

这段代码看起来很混乱:

FAT32

尝试:

destination.deleteMessages("selector")

:-)