I have several services configured in jboss-esb.xml, when I send message to one of the service, my message will be received by one of the configured services (even though the message is not meant for that service)!
If I send the same message again, another service will process that message (in round-robin maner), it is not random, it is like each service takes turn to intercept the message.
Example, if I have 3 services configured. First time I send a message, Service 1 will receive it, second time I send a message, Service 2 will receive it, third time I send the message, Service 3 will receive it. Fourth time I send it, Service 1 will receive it and the cycle repeat..
I suspect there is something wrong with the way I configured my jboss-esb.xml, but I am clueless.
Here is how I invoke the service,
ServiceInvoker invoker = new ServiceInvoker("NTIAdaptor", "SearchAccountByParentInternalId");
Message replyMessage = invoker.deliverSync(requestMessage, TIMEOUT);
And here is the jboss-esb.xml,
<?xml version="1.0"?>
<jbossesb parameterReloadSecs="5"
xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd http://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
<providers>
<jms-provider connection-factory="ConnectionFactory" name="JMS Provider">
<jms-bus busid="NTI">
<jms-message-filter dest-name="queue/NTIAdaptor" dest-type="QUEUE"/>
</jms-bus>
</jms-provider>
</providers>
<services>
<service category="NTIAdaptor"
description="SearchAccountByExternalId" name="SearchAccountByExternalId">
<listeners>
<jms-listener busidref="NTI" name="JMS"/>
</listeners>
<actions mep="RequestResponse" webservice="true">
<action class="com.krona.esb.action.AuthenticateAction" name="authenticate"/>
<action class="com.krona.esb.action.LogAction" name="logStart"/>
<action
class="com.krona.esb.account.action.SearchAccountByExternalIdAction"
name="process" process="process"/>
<action class="com.krona.esb.action.LogAction" name="logEnd"/>
</actions>
</service>
<service category="NTIAdaptor"
description="SearchAccountByInternalId" name="SearchAccountByInternalId">
<listeners>
<jms-listener busidref="NTI" name="JMS"/>
</listeners>
<actions mep="RequestResponse" webservice="true">
<action class="com.krona.esb.action.AuthenticateAction" name="authenticate"/>
<action class="com.krona.esb.action.LogAction" name="logStart"/>
<action
class="com.krona.esb.account.action.SearchAccountByInternalIdAction"
name="process" process="process"/>
<action class="com.krona.esb.action.LogAction" name="logEnd"/>
</actions>
</service>
<service category="NTIAdaptor"
description="SearchAccountByParentInternalId" name="SearchAccountByParentInternalId">
<listeners>
<jms-listener busidref="NTI" name="JMS"/>
</listeners>
<actions mep="RequestResponse" webservice="true">
<action class="com.krona.esb.action.AuthenticateAction" name="authenticate"/>
<action class="com.krona.esb.action.LogAction" name="logStart"/>
<action
class="com.krona.esb.account.action.SearchAccountByParentInternalIdAction"
name="process" process="process"/>
<action class="com.krona.esb.action.LogAction" name="logEnd"/>
</actions>
</service>
<service category="NTIAdaptor"
description="SearchAccountByServiceExternalId" name="SearchAccountByServiceExternalId">
<listeners>
<jms-listener busidref="NTI" name="JMS"/>
</listeners>
<actions mep="RequestResponse" webservice="true">
<action class="com.krona.esb.action.AuthenticateAction" name="authenticate"/>
<action class="com.krona.esb.action.LogAction" name="logStart"/>
<action
class="com.krona.esb.account.action.SearchAccountByServiceExternalIdAction"
name="process" process="process"/>
<action class="com.krona.esb.action.LogAction" name="logEnd"/>
</actions>
</service>
</services>
</jbossesb>
You are experiencing that problem because you're using the same jms-bus across services. Try using a different jms-bus for each service jms listener.
If is not what Manuel says, we had a similar problem to yours, messages were getting to the wrong services.
In our case it was that the juddi register wasn't altered when we changed a listener from one services to another. So we ended with 2 services listening to the same queue.
Related
I have a configured gateway and one dialplan for bridging an inbound call through the gateway to another number. This part works.
Now I want that the number of the inbound call is displayed in the phone after the bridge. This part doesn't work. I've tried many combinations, but every time the number from the provider is shown up.
/etc/freeswitch/sip_profiles/external/MyGateway.xml
<gateway name="MyGateway">
<param name="username" value="SIP_USERNAME"/>
<param name="password" value="SIP_PASSWORD"/>
<param name="proxy" value="sip.provider.com"/>
<param name="register" value="true"/>
</gateway>
/etc/freeswitch/dialplan/public/MyExtension.xml
<extension name="bridge">
<condition field="destination_number" expression="^SIP_USERNAME$">
<action application="set" data="bypass_media=true"/>
<action application="bridge" data="sofia/gateway/MyProvider/+49123456789"/>
</condition>
</extension>
This is what i've tested in the dialplan before the line with "bypass_media=true"
some of the commands changed the INVITE and/or RINGING request, but nothing changed the number on the phone after the bridge. I've also tried "export" instead of "set".
(I know that I can get the caller number with ${caller_id_number} - I just used 'ImCallingYou' for easy debugging)
<action application="set" data="initial_callee_id_name='ImCallingYou'"/>
<action application="set" data="initial_callee_id_number=999999999"/>
------------------------------------------------------------------------------------------
--> Remote-Party-ID: "ImCallingYou" <sip:999999999#GATEWAY_IP>;party=calling;privacy=off;screen=no
<action application="set" data="origination_caller_id_name='ImCallingYou'"/>
<action application="set" data="origination_caller_id_number=999999999"/>
------------------------------------------------------------------------------------------
--> nothing changed
<action application="set" data="sip_callee_id_name=ImCallingYou"/>
<action application="set" data="sip_callee_id_number=999999999" />
------------------------------------------------------------------------------------------
--> Remote-Party-ID: "ImCallingYou" <sip:999999999#GATEWAY_IP>;party=calling;privacy=off;screen=no
<action application="set" data="effective_caller_id_name=ImCallingYou"/>
<action application="set" data="effective_caller_id_number=999999999"/>
------------------------------------------------------------------------------------------
--> From: "ImCallingYou" <sip:SIP_USERNAME#sip.provider.com>;tag=1010101010101
<action application="set" data="sip_from_display=ImCallingYou"/>
------------------------------------------------------------------------------------------
--> nothing changed
<action application="set" data="sip_cid_type=pid"/>
<action application="set" data="origination_caller_id_name=ImCallingYou"/>
<action application="set" data="origination_caller_id_number=999999999"/>
------------------------------------------------------------------------------------------
--> nothing changed
<action application="set" data="sip_cid_type=rpid"/>
<action application="set" data="origination_caller_id_name=ImCallingYou"/>
<action application="set" data="origination_caller_id_number=999999999"/>
------------------------------------------------------------------------------------------
--> nothing changed
<action application="bridge" data="{sip_cid_type=rpid,origination_caller_id_name=ImCallingYou,origination_caller_id_number=999999999}sofia/gateway/MyProvider/+49123456789"/>
------------------------------------------------------------------------------------------
--> From: "ImCallingYou" <sip:SIP_USERNAME#sip.provider.com>;tag=10101010101
--> Remote-Party-ID: "ImCallingYou" <sip:999999999#GATEWAY_IP>;party=calling;privacy=off;screen=no
Have you tried this in Gateway config:
<param name="caller-id-in-from" value="true"/>
https://freeswitch.org/confluence/display/FREESWITCH/Gateways+Configuration#GatewaysConfiguration-CallerID
Want to enable https on my REST JSON WCF service and test it in IE browser.
WSDL is loading with no issues (https://localhost/myservice/Imyservice.svc?WSDL).
But i tried to call a operation ( https://localhost/myservice/Imyservice.svc/Getdata), I am getting
Request Error The server encountered an error processing the request. .
Below is my web.config. Can anyone help me with this
<webHttpBinding>
<binding name="SecureBasicRest" allowCookies="true" >
<security mode="Transport" />
<readerQuotas maxDepth="32"/>
</binding>
</webHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="svcBehavior">
<serviceMetadata httpsGetEnabled="true" httpGetEnabled="false"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="svcEndpoint">
<webHttp helpEnabled="true"/>
</behavior>
</endpointBehaviors>
</behaviors>
<services>
<service name="myservice.Imyservice" behaviorConfiguration="svcBehavior">
<endpoint binding="webHttpBinding" bindingConfiguration="SecureBasicRest"
behaviorConfiguration="svcEndpoint" name="webHttp"
contract="myservice.Imyservice" />
</service>
</services>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
The root cause is that there is something wrong with the definition of the service endpoint.
<service name="myservice.Imyservice" behaviorConfiguration="svcBehavior">
<endpoint binding="webHttpBinding" bindingConfiguration="SecureBasicRest"
behaviorConfiguration="svcEndpoint" name="webHttp"
contract="myservice.Imyservice" />
</service>
Your idea is correct, we should add a service endpoint with transport security mode. However, the service name should be a fully qualified name of the service implemented class instead of the service interface.
<service name="myservice.myservice"
Feel free to let me know if the problem still exists.
I am currently using variable substitution in VSTS however I have hit a roadblock on how to select specific elements from a list.
I must supply both a name for the variable I want to substitute and a key with which to substitute the old value. I can use . to select nested elements in config.
I have the following app.config.
<services>
<service behaviorConfiguration="ServiceBehaviour" name="Application.Project01">
<endpoint address="" behaviorConfiguration="webBehavior" binding="webHttpBinding" bindingConfiguration="web" contract="Application.Interface01">
<identity>
<dns value="dns01" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost/Project01/" />
</baseAddresses>
</host>
</service>
<service behaviorConfiguration="ServiceBehaviour" name="Application.Project02">
<endpoint address="" behaviorConfiguration="webBehavior" binding="webHttpBinding" bindingConfiguration="web" contract="Application.Interface02">
<identity>
<dns value="dns01" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost/Project02/" />
</baseAddresses>
</host>
</service>
</services>
I would like to be able to substitute variables in each one of these services individually. The specific keys I am interested in are services.service.endpoint.identity.dns.value and services.host.baseaddresses.add.baseaddress.
I have tried the following to edit the dns value
services.1.service.endpoint.identity.dns
services.1.service.endpoint.identity.dns.value
The task that I am using is the Azure App Service Deploy version 3.*
For XML variable substitution feature of Azure App Service Deploy task, it takes effect only on the applicationSettings, appSettings, connectionStrings, and configSections elements of configuration files.
So you can’t use it to achieve your requirement.
You can try it with XML Transformation.
You also can try it with other tasks, such as Release Management Utility tasks or others.
I am using JBoss AS 5.1.0 and Jboss ESB 4.10
I am trying to Invoke a Service which has a single action. I have Set MEP = oneWay for the Service.
When I Invoke the Service Using the Below Method I do not get a reply but an Exception.
new ServiceInvoker("Chapter3Sample", "Chapter3Service").deliverSync(esbMessage, 10000);
WHen I change mep=RequestResponse : I am able to get the Reply
As per my understanding ESB Message has a ReplyTo field (Since I am invkoing a Sync Request) the Message should be returned back by the last Action which is not happening in my case. Please find below the ESB XML:
<?xml version="1.0"?>
<jbossesb parameterReloadSecs="5"
xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd http://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
<providers>
<jms-provider connection-factory="ConnectionFactory" name="JBossMQ">
<jms-bus busid="chapter3GwChannel">
<jms-message-filter dest-name="queue/chapter3_Request_gw" dest-type="QUEUE"/>
</jms-bus>
<jms-bus busid="chapter3EsbChannel">
<jms-message-filter dest-name="queue/chapter3_Request_esb" dest-type="QUEUE"/>
</jms-bus>
</jms-provider>
</providers>
<services>
<service category="Chapter3Sample"
description="A template for Chapter3" name="Chapter3Service">
<listeners>
<jms-listener busidref="chapter3GwChannel" is-gateway="true" name="Chapter3GwListener"/>
<jms-listener busidref="chapter3EsbChannel" name="Chapter3Listener"/>
</listeners>
<actions mep="OneWay">
<action class="org.jboss.soa.esb.samples.chapter3.MyAction"
name="BodyPrinter">
<property name="process" value="displayMessage"/>
<property name="symbol" value="*"/>
<property name="count" value="50"/>
<property name="propertyName">
<hierarchicalProperty attr="value">
<inner name="myName" random="randomValue"/>
</hierarchicalProperty>
</property>
<property name="exceptionMethod" value="processException"/>
<property name="okMethod" value="processSuccess"/>
</action>
</actions>
</service>
</services>
</jbossesb>
When your are invoking call as synchronus.
new ServiceInvoker("Chapter3Sample", "Chapter3Service").deliverSync(esbMessage, 10000).
set mep=RequestResponse.
when your are invoking call asynchronus.
new ServiceInvoker("Chapter3Sample", "Chapter3Service").deliverASync(esbMessage, 10000).
set mep=oneWay .
I've recently discovered the web.config automatic transformation in the web deploy tool of visual studio 2010.
It's working well, but I have a scenario I can't seem to get working.
Assume I have the following root Web.config
<services>
<service name="Service1">
<endpoint address="" binding="customBinding" bindingConfiguration="LargeBufferBinding"
contract="Service1" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
<service name="Service2">
<endpoint address="" binding="customBinding" bindingConfiguration="LargeBufferBinding"
contract="Service2" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
<service name="Service3">
<endpoint address="" binding="customBinding" bindingConfiguration="LargeBufferBinding"
contract="Service3" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
For my Web.Release.config, I want all the endpoint nodes with a binding of mexHttpBinding to be removed.
I've used the following in my Web.Release.config:
<services>
<service>
<endpoint binding="mexHttpBinding" xdt:Locator="Match(binding)" xdt:Transform="Remove" />
</service>
</services>
However, this will only remove the first match, in the Service1, but not the following ones.
I've tried various way of locating the node, on the endpoint and service node, but only the first match ever gets replaced.
Is there a way to get all the <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> to be removed ?
Thanks.
I've just tried this and using RemoveAll instead of Remove seems to do the trick:
<services>
<service>
<endpoint binding="mexHttpBinding" xdt:Locator="Match(binding)" xdt:Transform="RemoveAll" />
</service>
</services>