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?
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.
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%
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.
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