Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Implementing a PasswordHandler for Service Activity Monitoring

Hi All,
I am persisting messages for an ESB service into an Oracle database so they can be monitored using Service Activity Monitoring, allowing us to view all incoming and outgoing messages.
I am now trying to implement a PasswordHandler so we can 'redact' certain information before it is stored in the database. I have added a PasswordHandler bean to the Spring configuration of my ESB route, but this isn't having any impact on the data, i.e. 'inputString' is still stored in the database. The job is deployed into the ESB container and has been developed in Talend Platform for MDM (5.6.1).

Has anyone been able to successfully implement this who could provide any pointers?

Many thanks

0683p000009MGsz.png
Labels (3)
7 Replies
Anonymous
Not applicable
Author

Hi,

It may not works if you put the Handler/Filter bean into the spring configuration of the Route, because org.talend.esb.sam.agent.feature.EventFeature is exposed as OSGi service
{code}
<osgi:service ref="eventFeature" interface="org.talend.esb.sam.agent.feature.EventFeature"/>
{code}
and is referenced by your Route
{code}
<bean id="route" class="......">
        <property name="eventFeature">
            <osgi:reference interface="org.talend.esb.sam.agent.feature.EventFeature" />
        </property>
<bean>
{code}

The Handlers/Filters can be autowired into EventFeature, but only before EventFeature is exposed as OSGi service.
Currently, you may have to provide your PasswordHandler into the sam-agent bundle (container/system/org/talend/esb/sam-agent/5.6.1/sam-agent-5.6.1.jar), there is an example sample-filters-context.xml in the sam-agent-5.6.1.jar/META-INF/tesb, you may add the PasswordHandler bean into this spring xml.
Anonymous
Not applicable
Author

Hi Dai,

Thank you for your reply. I have added the passwordhandler to sample-filters-context.xml in sam-agent-5.6.1.jar, and restarted the esb container as suggested, but the tag 'inputString' is still not replaced in the database. Do you have any further suggestions?

I have attached the sample-filters-context.xml file below for reference.

Thanks,

Sam


  <?xml version="1.0" encoding="UTF-8" ?>
- <!--
#%L
Service Activity Monitoring :: Agent
%%
Copyright (C) 2011 - 2012 Talend Inc.
%%
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at



Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#L%

  -->
- <beans xmlns="" xmlns:xsi="" xsi:schemaLocation="">
- <bean id=" stringContentFilter" class=" org.talend.esb.sam.common.filter.impl.StringContentFilter">
- <property name=" wordsToFilter">
- <list>
  <value>abc</value>
  </list>
  </property>
  </bean>
- <bean class=" org.talend.esb.sam.common.filter.impl.JxPathFilter">
  <constructor-arg value=" content='test' and eventType='FAULT_IN' and customInfo/key1='value1'" />
  </bean>
- <bean id=" passwordHandler" class=" org.talend.esb.sam.common.handler.impl.PasswordHandler">
- <property name=" tagnames">
- <list>
  <value>inputString</value>
  </list>
  </property>
  </bean>
- <bean id=" fixedPropertiesHandler" class=" org.talend.esb.sam.common.handler.impl.CustomInfoHandler">
- <property name=" customInfo">
- <map>
  <entry key=" Application name" value=" Dummy App" />
  <entry key=" Stage" value=" Dev" />
  </map>
  </property>
  </bean>
  </beans>
Anonymous
Not applicable
Author

Hi,
Have you executed the "update sam-agent" command on ESB container console? which will make the changed sam-agent bundle take effect.
Anonymous
Not applicable
Author

Hi Dai,

Yes I have issued the command update sam-agent but the tag 'inputString' still remains in the database,

Sam
Anonymous
Not applicable
Author

Hi all,
Does anyone have any more ideas about why my passwordHandler is not being picked up and applied to the messages?
Anonymous
Not applicable
Author

Hi, Sam,

Seems I found the reason why the passwordHandler is still not take effect, because the sample-filters-context.xml is not imported into the META-INF/tesb/agent-osgi.xml. (or you may just copy the passwordHandler bean into the agent-osgi.xml)

After that, don't forget to update sam-agent and also redeploy your route kar.

Could you try it and see if it works?

Regards.
sam-hubbard
Contributor
Contributor

Hi Dai,
Thank you for your reply,
I updated the agent-osgi.xml file and refreshed the SAM agent bundle and this seems to have fixed my problem - I can now prevent specified tags from being persisted in the database.
Thanks for your help,
Sam