How to do Pub/Sub on WSO2 Message Broker with WCF - c#

There seems to be very little information on interacting with the WSO2 products from WCF or .Net in general. I am attempting to subscribe to a Topic which is defined in the WSO2 Message Broker, but I have no idea where to start. Eventually, I'd like to publish events from a C# application, but again, I could use some help finding a starting point.
I've successfully coded something up using the RabbitMQ .net libraries, but only for reading/writing to a queue, not a topic. Thanks in advance for any help.

I think you can do this using WS-Eventing API by writing a C# client. You can refer the section on WS-Eventing in this article. Unfortunately, the example code is in Java.

Related

Laravel Send a Notification to C# Application

I am looking to create some sort of a function that would send Laravel notifications to C# application. The idea is that whenever a user purchases someone, an administrator is then notified by receiving a notification through a C# application that they would run on their PC. However, at the moment the only way I can think of is by creating a listening server in C# and then just send the data via sockets through PHP. Is there anything else that would be considered a better approach?
Kind Regards,
George
You can build an event-driven system. Your Laravel application will be producer which responsible for send events, and C# application will be consumer. There are lots of options to do it.
I would like to recommend AWS SQS. Also, you can easily create a Lambda, then you can add your newest queue as a trigger. When you do this, you will have a serverless architecture, and you won't worry about the scaling part, AWS handles these stuffs. Also, you can check this. It can be a good start point to meet serverless architecture.

Solace JNDI/JMS Syntax for C# .NET

A vendor is using Solace to send messages. I have obtained a SubscriptionId using web service call, that I supposed to be submitted to the Solace server.
Using the documentation and sample code at dev.solace.com, I have been able to connect a session. However, I am lost as to how to go to the next step which is to subscribe to what I believe is a queue using a connection factory, jndi factory an jms destination name.
The sample shows this:
Session.Connect(ContextFactory.Instance.CreateQueue(Topic), true);
But from what I can tell, that won't work as the vendor wants jndi/jms, and the Solace documentation has no .NET code for jndi/jms, which leaves me guessing.
Help!
Please use the JMS API instead of the .NET API in order to perform JMS.
The .NET API does not do JMS.
Note that you can send/receive messages using the .NET API that's inter-operable with the JMS API.
However, since you have a hard requirement to use JMS, your only option is to use the JMS API.
As It turns out, the jndi/jms information delivered by the host for configuration was unneeded. What was necessary was to connect to the queue and receive the messages.

Publish/Subscribe with RabbitMQ over HTTP

I have a requirement where messages should be published/subscribed over http with Advanced Message Queuing Protocol (AMQP - I am using RabbitMQ C# client), just like the sample chat application works with its json_rpc_channel plugin.
Please guide me through any valuable resource available to you.
Official .NET SDK
EasyNETQ - Easy to use wrappers
If you can post specific requirement, pointers can be provided
Update:
Publish
Subscribe

What's the advantage of a WCF client if I can use a Webservices 2.0 client just as fine?

Recently a couple of WCF services have been introduced to our company's API.
There are sample implementations for Windows that make use of proxy codes generated by Visual Studio 2010 (either full WCF client or Silverlight code). All looking nice.
Then I figured out that it is also possible to let Studio generate a Webservices 2.0 client code proxy and what can I say:
It works just as fine as the WCF client
It also returns real objects, just like WCF
It is also using SOAP
What the heck is the difference/advantage of a native WCF client?
Please note that I'm especially interested in the CLIENT SIDE. The server side is a different story. The point is: why would I connect to a WCF server using WCF client code if Web Services client code works as good?
I can also ask with regards to MONO: WCF support in Mono is far from being perfect, while WebServices 2.0 are woking pretty well. So after fighting with WCF for a while I switched back to a WS 2.0 client code proxy and have not noticed any issues so far. Are there problems I will have to expect?
Flexibility.
Today, you're hitting that service via HTTP. Tomorrow, you might want to add some persistance and hit it via MSMQ. Using WCF that's a configuration change - using Webservice client code you're looking at a complete rewrite of that area of your code.
Another benefit is the ability to turn on tracing, message logging and diagnostics with nothing more than a configuration change.
See Administration and Diagnostics, which says
Diagnostics Features Provided by WCF
WCF provides the following diagnostics functionalities:
End-To-End tracing provides instrumentation data for troubleshooting an application without using a debugger. WCF outputs
traces for process milestones, as well as error messages. This can
include opening a channel factory or sending and receiving messages by
a service host. Tracing can be enabled for a running application to
monitor its progress. For more information, see the Tracing topic. To
understand how you can use tracing to debug your application, see the
Using Tracing to Troubleshoot Your Application topic.
Message logging allows you to see how messages look both before and after transmission. For more information, see the Message Logging
topic.
Event tracing writes events in the Event Log for any major issues. You can then use the Event Viewer to examine any abnormalities. For
more information, see the Event Logging topic.
Performance counters exposed through Performance Monitor enable you to monitor your application and system's health. For more
information, see the WCF Performance Counters topic.

Dynamic WCF service coupling on IIS

I am trying to build a service mechanism which should be add-on based and communicating through a publish subscribe system. It must be based on WCF services.
What I have right now is a concept which I can't get to work so I decided to ask you because maybe I am going at this the wrong way (I only just started using WCF).
What I want to achieve is making a single core service with session persistency which can be extended by linking an unknown number of add-on services. I want to set up the publish subscribe system at runtime, not at buildtime, so the core-service should be able to detect what add-on services are available (using the web.config?) and then bind them to the message bus.
From the front end (ASP classic) it must be possible to access any .svc file but, maintaining session, each .svc file must be connected to the message bus.
All is hosted in a single IIS active directory.
Can you give me some hints as to where to look?
I am especially interesed in:
WCF dynamic discovery
WCF to WCF communication on the same host (in the same active directory even)
Thanks in advance, hope you can help!
Update
Thanks for your answers, I'll read up at the links you send me. I'll post my final concept solution here in due time for future reference.
My 2 cents about Publish subscribe mechanism using WCF - WCF is not inherently built for pub/sub mechanism. It is built for Request/Response model of communication. Have a look at the NService Bus for pub/sub here
Talking about Add on services on top of core service, I am not able to get What you want exactly ? Is it the Routing service which you want ? WCF 4 now provides routing service For more information look here The link also talks in detail about the discovery mechanism in WCF 4.
Also have a look the Agatha framework which also have single WCF service and no. of request handlers where in the framework will decide which request handler to call based on each request.
Search for Agatha - Davy brion for more information
I was having a similar problem since I have one common WCF service but the implementation depends on the user's role so it was kind of difficult to do that at runtime.
I found this tutorial on the matter which runs great for my propouses: http://blog.micic.ch/net/dynamic-iis-hosted-wcf-service
I have tested in my env and is very powerful technique. Hope that helps you as well. Cheers.

Categories