Which one is best to use as performance wise: Service chaining or Callout midiator in wso2 ESB - wso2-esb

I have created a service, which internally calls some other service.
Now in some situation, I am thinking to use callout mediator. But someone told me that Callout Mediator is not good as performance point of view.
So I need your suggestion that what should I use, service chaining or Callout mediator?

You need to decide based on your Scenario.
If you want your service calls to be blocked, then you can go with Callout Mediator or else if you need chained invocation, you can go with ServiceChaining
The link will explains you clearly,
http://supunk.blogspot.in/2010/06/difference-between-service-chaining-and.html
Hope this helps!!

Related

Spring Data Rest: How do I add logic before validation?

I need to massage some data before a javax validation on save is run. Using "beforeCreate" doesn't work because apparently the validator is called before the "beforeCreate" is. Is there another ApplicationEvent I can use?
Alternatively, can someone answer where I can place business logic in the Spring Data Rest framework? Usually there is a service layer, but they don't seem to exist in this infrastructure.
I think this is not possible. The RepositoryEventHandler and Validator are the hooks that you can work with. If you need more you have to fall back to custom Controllers.
From my point of view the RepositoryEventHandler methods would be the place to plug in up your business logic. You can have a service class as a central place to put your service logic and let the RepositoryEventHandler invoke it.
Why would you actually try to execute business logic before the validation takes place?

Call WF Workflow from Browser

OK, I've searched the Internet for the answer to this and haven't found anything... maybe I'm missing the obvious here or just asking the wrong question, but...
How do you call a WF WCF Workflow just by it's URL with parameters? I have a Workflow xmlx, we'll call it DeepThought.xamlx, an operation named TheQuestion and I need to pass the parameter Answer = 42 to it.
I've tried http://localhost:8042/DeepThought.xamlx/TheQuestion?Answer=42 and just about everything else I can think of. I've scoured the Internet and even the wsdl but am either just flat out missing the answer or simply not seeing it.
I assume it's possible, otherwise, what's the point? Clues appreciated.
At least out-of-the-box this is not possible. The standard Receive
activity uses SOAP. I'm sure it's possible to implement a custom Receive but I guess it would be a non-trivial amount of work.
You can also take a look a the following questions. They are REST-related but still may give you some options (a community RESTful endpoint is being mentioned, no idea of its current state though):
RESTful Workflow Service Endpoints in WF4 / WCF
WCF Workflow Service REST interface
I ended up implementing the workflow as a regular activity (non service) inside WCF. This gave me the ability to use their parameters and pass them to the workflow directly. In the end, not too difficult to implement.

Action vs Reply action WCF

What's the use of action/reply action for service operation in WCF. So far, what I've understood is; action is used by WSDL to identify the service operation to which the message from the client belongs and in return reply action is used by service operation to identify the caller to which reply message belong --> Please correct me if I am wrong with this!
Now, I want to understand; what's the real use (apart from handling anonymous messages by using aster ix [*]), I mean this could well be handled internally by WCF instead of exposing it to the developer.
Also, why is action and replyaction required at all? I mean, we already have a name property for the service operation to identify the method and when I call Proxy.SomeMethod() then somemethod is already mapped to the Name property and it should be enough to identify the destination method for the message and similarly the replyaction. Please clarify.
Can I please get a simple real world scenario/or link to that to understand Action/ReplyAction in real life.
Many Thanks.
Actions are part of the various SOAP and WS-* specifcations.
So the first point is that this is not something unique to WCF it is a standard part of the specification you need to support if you want to have interoperable web services. They are used for message routing and other message handling functions.
Second, WCF DOES manage these by default. You only need to specify them yourself if you wish to customise or manage them in some other way. E.g. WCF will automatically generate them into the WSDL for you. WCF will also use them by default when it is selecting which operation to invoke for an incoming message. Again, WCF provides extension points to customise this behavior if you require.

What WCF extensibility point should I use to implement custom security?

I'm trying to create a flexible security infrastructure for our WCF services on our intranet, but I'm not quite sure where I should be putting this code... there are so many different ways to extend WCF that I don't know for sure where to begin...
The basic idea: every time my service is called - for any operation - I want some code to run that does a custom access check using our existing security infrastructure to see if the user has access to perform the operation. If the user isn't authorized, I want it to throw an exception or something (not sure what it should do really) and prevent the call from ever making it to my service code.
Thoughts?
Thanks
I think that this will be a good starting point for implementing a custom authorization strategy.
I ended up having to use a MessageInspector in conjunction with a ParameterInspector to make it work how I needed.

How do you specify a message label when using WCF and NetMsmqBinding?

I would like to set the MSMQ message label using the NetMsmqBinding. I understand it’s easy when using the MsmqIntegrationBinding, but I would like to continue to use the NetMsmqBinding (even call private methods, if possible)
I thought this was an interesting question. Unfortunately, from everything I've seen, it looks like you can't access the Label property on an outgoing MSMQ message using NetMsmqBinding.
Here are some of the links I came across:
http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/3389679b-a130-4e83-bb4c-1b522c216227/
http://blogs.msdn.com/skaufman/archive/2007/12/17/msmq-label-property-and-wcf.aspx
I couldn't find anything that explained exactly why, but the reasoning makes sense - the NetMsmqBinding does not expose anything specific to System.Messaging, so that the binding itself can be easily swapped out for another binding without any code changes. Like you said, the MsmqIntegrationBinding is tightly coupled to System.Messaging concepts, so you get access to all the System.Messaging stuff at the expense of interchangability with other bindings. If setting the Label is important, the easiest route will probably be to just use msmqIntegrationBinding.
George: No answer, but I'm curious to know how you plan to use the MSMQ label together with NetMsmqBinding.
The reason I ask is that NetMsmqBinding was really created to support the scenario in which both the sending and receiving endpoints are both WCF applications, so at that point you might as well just stick any out-of-band data you need in the message headers...
Use OperationContext.Current.IncomingMessageProperties.Values