Make sure to get singleton instance of ConfigurationContext.
when you do setProperty and getProperty from ServiceContext note that you are obtaining a shared copy of Property object per jvm, so instead of "testid" key, use a unique key,
ex: In client side code after stub initialization instead of,
channelConnectServiceStub._getServiceClient().getServiceContext()
.setProperty("testid","testidval");
try
channelConnectServiceStub._getServiceClient().getServiceContext()
.setProperty(stub._getServiceClient().getServiceContext().getName(), "testidval");
and to retrieve the property, in loghandler use the same key (the msgContext.getServiceContext().getName()
is unique per flow)
Instead of
messageContext.getServiceContext().getProperty("testid");
try
messageContext.getServiceContext()
.getProperty(msgContext.getServiceContext().getName());
also note as you are storing values on a jvm shared Property object, to avoid memory growth remove the value once its no longer needed.
messageContext.getServiceContext()
.removeProperty(msgContext.getServiceContext().getName();