<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
How to implement queue to service mapping
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/m.myslik">Martin MyslĂk</a> in <i>JBoss ESB Development</i> - <a href="https://community.jboss.org/message/829924#829924">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>I am working on a tool for visualisation of messages intercepted in JBossESB. The problem is, that when I intercept a message (using <strong>Pipeline Interceptor</strong>), I get the full service name + listener from the <strong>sender</strong> field (message.<em>getFrom()</em>), but I only get <em>queue</em> from the <strong>receiver</strong> field (message.<em>getTo()</em>).</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I would like my communication to look like <strong>message: service ---> service</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>At the moment, I am trying to acomplish this by implementing a hashMap which would map every queue to corresponding service. I am able to retrieve some information from registry by doing this:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: 'courier new', courier;">System.out.println("---Loading all services in registry---");</span></p><p><span style="font-size: 10pt; font-family: 'courier new', courier;">reg = RegistryFactory.getRegistry();</span></p><p><span style="font-family: 'courier new', courier;">List<String> services = reg.findAllServices();</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>But this only returns the <strong>listeners</strong> of my registered services - not their <strong>categories!</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>This is the output: <span style="color: #222222; font-family: 'courier new', courier; background-color: #ffffff;">[JBpmCallbackService, DeadLetterService, SimpleListener, BlueListener]</span><strong><br/></strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>It would be easy for me to retrieve desired information using this:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: 'courier new', courier;">System.out.println(reg.findEPR("BlueServiceESB", "BlueListener"));</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: arial, helvetica, sans-serif;">But I have no idea, how to get the <strong>category</strong>, if I only know the correspong <strong>listener</strong>, In other words, I would like to use it like this:</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: 'courier new', courier;">System.out.println(reg.findEPR(MAGIC GOES HERE, services.get(i)));</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: 'courier new', courier;"><span style="font-family: arial, helvetica, sans-serif;">Thanks for any tips.. I am literally lost here :-(</span><br/></span></p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/829924#829924">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss ESB Development at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2032">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>