Service Virtualization

Expand all | Collapse all

How to extract EXACT value(not byte format) of Message Id and Corelation Id in a MQ Devtest 9.5.1 depreciated step

  • 1.  How to extract EXACT value(not byte format) of Message Id and Corelation Id in a MQ Devtest 9.5.1 depreciated step

    Posted Mar 30, 2017 05:06 PM

    Hello All,

     

    I tried applying the Extract Details filter and having prefix req but the value I get from it is not the actual value, its in some byte or some other format.

    I also tried applying conversion logic by implementing a code which I read in forum using com.Util.binary.toHex something like this but I got error Util Class doesnt have toHex method.

     

    Kindly also advice I need to see the value of Corelation Id also which is set when my Response is sent from Response Queue. So that I can proof that Message id for Request Queue is same as Correlation ID for Response Queue.

     

    ( I need proper String or HEx String value whatever it is i gues 45-50characters long value but in LISA we get Byte format in lisa.vse.messageid property)

     

    Support is appreciated.!!Thanks



  • 2.  Re: How to extract EXACT value(not byte format) of Message Id and Corelation Id in a MQ Devtest 9.5.1 depreciated step

    Posted Mar 31, 2017 04:05 AM

    Hi,

     

    you can convert the byte[] value to Hex with a Script step.  

    Please try this method: com.itko.util.BinaryUtil.toHex(byte[]).

     

    Jan



  • 3.  Re: How to extract EXACT value(not byte format) of Message Id and Corelation Id in a MQ Devtest 9.5.1 depreciated step

    Posted Apr 03, 2017 04:47 AM

    Hello Jan,

     

    I tried this script but got error stating that could not find the method .toHex . I wrote import util.* before my code.

     

    Can you please tell me what all packages do I need to import to make this code run?? ( Also does it work in dev test and 7.5 both )



  • 4.  Re: How to extract EXACT value(not byte format) of Message Id and Corelation Id in a MQ Devtest 9.5.1 depreciated step

    Posted Apr 03, 2017 04:51 AM

    havja02 - I mean import com.itko.util.*



  • 5.  Re: How to extract EXACT value(not byte format) of Message Id and Corelation Id in a MQ Devtest 9.5.1 depreciated step

    Posted Apr 03, 2017 05:57 AM

    Hey I am using this code, do you thing its fine??

    // This Beanshell script should return a boolean result indicating the assertion is true or false
    import com.itko.util.*;



    testExec.setStateValue("IncomingMessageIDValue",com.itko.util.BinaryUtil.toHex(testExec.getStateValue("req.message.id.bytes")));

    return false;