<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.EmailStyle17
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;
font-weight:normal;
font-style:normal;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;
font-weight:normal;
font-style:normal;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Hello,</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">I couldn’t hit this service from Java Class. But I could hit through rest client Url :
<a href="http://qot-job-03:15672/api/queues/%2F/validate.monitor/get">http://qot-job-03:15672/api/queues/%2F/validate.monitor/get</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">I know the issue with url encoding and decoding.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black"> String url =</span><span style="font-size:10.0pt;font-family:Consolas;color:#2A00FF">"<a href="http://qot-job-03:15672/api/queues/%2F/validate.monitor/get">http://qot-job-03:15672/api/queues/%2F/validate.monitor/get</a>"</span><span style="font-size:10.0pt;font-family:Consolas;color:black">;</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in;text-indent:.5in;text-autospace:none">
<b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">try</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black"> {</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black"> result =
</span><span style="font-size:10.0pt;font-family:Consolas;color:#0000C0">restTemplate</span><span style="font-size:10.0pt;font-family:Consolas;color:black">.exchange(url, HttpMethod.</span><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000C0">POST</span></i><span style="font-size:10.0pt;font-family:Consolas;color:black">,
entity, QueueMonitorRespone.</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">class</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black">);</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black"> System.</span><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000C0">out</span></i><span style="font-size:10.0pt;font-family:Consolas;color:black">.println(</span><span style="font-size:10.0pt;font-family:Consolas;color:#2A00FF">"Sample
Response :: "</span><span style="font-size:10.0pt;font-family:Consolas;color:black">+result.getBody());</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">
</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black"> }</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7F0055">catch</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black"> (HttpClientErrorException e) {</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black"> e.printStackTrace();</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:Consolas;color:black"> }</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">Please need your help to resolve this.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">As per above code, the url is taking something like
</span><span style="font-size:10.0pt;font-family:Consolas;color:black"> </span><span style="font-size:10.0pt;font-family:Consolas;color:#2A00FF"><a href="http://qot-job-03:15672/api/queues/%252F/validate.monitor/get">http://qot-job-03:15672/api/queues/%252F/validate.monitor/get</a>
because “%” is decoded as “%25” and don’t want this to happen.</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:Consolas;color:#2A00FF"> </span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:Consolas;color:#2A00FF">Request Json :</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:Consolas;color:#2A00FF"> </span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">{"vhost":"/","name":"validate.monitor","truncate":"50000","requeue":"true","encoding":"auto","count":"1000"}<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Regards …</span><b><i><span style="font-size:24.0pt;font-family:Wingdings;color:#1F497D">?</span></i></b><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Srinath</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
</div>
</body>
</html>