Service Virtualization

  • 1.  Error while destroying JMS queues using companion flag

    Posted Jun 22, 2016 03:57 PM

    Hi All,

    As a part of "Set Final Step to Execute" companion I am trying to delete the queues from MoM but VSM throwing following error. Is there any way to get control of Listener connection object and close it. Please help.

     

    ============================================================================
    | Error in Script
    ============================================================================
    | Step: Cleanup Queues
    ----------------------------------------------------------------------------
    | Message: javax.jms.JMSException: Destination still has an active subscription: queue://request.proxy.queue
    ----------------------------------------------------------------------------
    | Trapped Exception: javax.jms.JMSException: Destination still has an active subscription: queue://request.proxy.queue
    | Trapped Message: javax.script.ScriptException: javax.jms.JMSException: Destination still has an active subscription: queue://request.proxy.queue
    ----------------------------------------------------------------------------
    STACK TRACE
    javax.script.ScriptException: javax.jms.JMSException: Destination still has an active subscription: queue://request.proxy.queue
    at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:348)
    at org.codehaus.groovy.jsr223.GroovyCompiledScript.eval(GroovyCompiledScript.java:41)
    at javax.script.CompiledScript.eval(CompiledScript.java:106)
    at com.itko.lisa.test.ScriptExecHandler.executeCompiledScript(ScriptExecHandler.java:501)
    at com.itko.lisa.test.UserScriptNode._execute(UserScriptNode.java:218)
    at com.itko.lisa.test.UserScriptNode.execute(UserScriptNode.java:175)
    at com.itko.lisa.test.TestNode.executeNode(TestNode.java:981)
    at com.itko.lisa.test.TestCase.execute(TestCase.java:1295)
    at com.itko.lisa.test.TestCase.execute(TestCase.java:1210)
    at com.itko.lisa.test.TestCase.executeNextNode(TestCase.java:1195)

    ......
    ============================================================================



  • 2.  Re: Error while destroying JMS queues using companion flag

    Posted Jun 22, 2016 05:25 PM

    I've been watching your efforts to have this kind of "self-contained" JMS service for a while and I strongly feel like you're making things way harder than they need to be.  If your service starts up ActiveMQ fresh when it starts, and shuts it down when it stops, then why does it have to clean up queues?    If you're using an existing ActiveMQ instance then is leaving the queues up for reach of your services really a burden?  I don't see the practicality of what you're doing outweighing the effort you're making to do it.

     

    Anyway.  In answer to your question, there's no "official" way to manually clean up the background subscriber/connection assets being used by a messaging VSM.  There is, however, a script you can run to clean up *all* background connection assets:

     

    testExec.getStateObject("lisa.hidden.assetstate").destroy(testExec);

     

    This should clean up all the background subscriber/connection assets immediately in most cases.



  • 3.  Re: Error while destroying JMS queues using companion flag

    Posted Jun 27, 2016 02:32 PM

    Thanks Kevin. Every time i am getting lisa.hidden.assetstate value as null so it seems background connection clean up immediately.

    Here is my current approach which is working fine - Different execution behaviour with Pre and Post steps in VSM



  • 4.  Re: Error while destroying JMS queues using companion flag
    Best Answer

    Posted Jun 27, 2016 02:48 PM

    The way assets interact with subprocess is not very well defined at this point, but I don't think you can access "lisa.hidden.assetstate" from a subprocess.  You have to do it from the same test case where those assets were opened.