So here it is that BlazeDS will totally play on GAE
BlazeDS Version: 3.2.0.3978 Status:
COMPATIBLE To workaround an
EMFException thrown by
flex.messaging.io.amf.AbstractAmfInput,
follow Martin Zoldano's workarounds at
http://martinzoldano.blogspot.com/2009/04/appengine-adobe-blazeds-fix.html.
You will need to enable sessions to
get BlazeDS working.
But I wonder does it mean that messages from the server to the client, server push notifications from BlaseDS (I mean we connect to server from flex client but do not require data and server sends data to us when it wants), and BTW does any one know where to get a tutorial on doing that (Flex + BlazeDS)?
Are there any more features of Blaze v 3.2 that are under question?
well i recently try a flex-blazeds app on google plattform and it doesnt works. I found a guide that fix blazeds to run on gae, u should try it. For a basic tutorial of messaging-services in blazeds u should look a this asotto.blogspot.com/ ,
Messaging does not work, unless if you are lucky enough to have all the consumers/producers registered on the same machine (highly improbable when you have a decent traffic).
If you want to understand why, you need to read the developer guide, clustering sections. Basically the whole pub/sub graph+messages queues is kept distributed on the cluster, and the machines are using JGROUPS for communication.
Obviously, it will not work on GAE (the machines allocated by Google will don't know one of each other, and you can lose messages).
With the official implementation of BlazeDS version 4 you have duplicated session problems, because of the GAE clustering mechanism.
Related
We have several Java standalone applications (in form of Jar files) running on multiple servers. These applications mainly read and stream data between systems. We are using Java 8 mainly in our development. I was put in charge recently. My main function is to manage and maintain these apps.
Currently, I check these apps manually by accessing these servers, check if the app is running, and sometimes run some database queries to see if the app started pulling data. My problem is that in many cases, some of these apps fail and shutdown due to data issue or edge cases without anyone noticing. We need some monitoring and application recovery in place.
We don't have docker infrastructure in place. We plan to implement docker in the future, but for now this is not an option.
After research, the following are options I thought of or solutions I tried:
Have the apps create a socket client which sends a heartbeat to a monitoring app (which needs to be developed). I am keeping this as my last option.
I tried to use Eclipse Vertx to wrap the apps into Verticles. Then create a web view that can show me status and other info. After several tries, the apps fail to parse the data correctly (might be due to my lack of understanding to Vertx library).
Have a third party solution that does this, but I have no idea what solutions are out there. I am open for suggestions.
My requirements are:
Proper monitoring of the apps running and their status.
In case of failure, the app should start again while notifying the admin/developer.
I am willing to develop a solution or implement a third party one. I need you guidance on this.
Thank you.
You could use spring-boot-actuator (see health). It comes with a built-in endpoint that has some health checks(depending on your spring-boot project), but you can create your own as well.
Then, doing a http request to http://{host}:{port}/{context}/actuator/health (replace with yours), you could see those health checks status and also use the response status code to monitor your application.
Have you heard of Java Service Wrappers? Not a full management functionality, however it would monitor for JVM crashes and out of memory conditions and restart your application for sure. Alerting should also be possible.
There is a small comparison table here: https://yajsw.sourceforge.io/#mozTocId284533
So some basic monitoring and management is included already. If you need more, I suggest using JMX (https://www.oracle.com/java/technologies/javase/javamanagement.html) or Prometheus (https://prometheus.io/ and https://github.com/prometheus/client_java)
We are in the process of integrating .Net applications which are deployed on VM's on premises data centers with pub/sub resource topic in Google cloud platform on the cloud. I have a scenario which I am currently not able to decide and would need help and a right direction. Below is the brief detail of the use case. Please have a look and provide your thoughts.
Currently there is a .Net application which is deployed on a Windows VM on legacy on-prem client data centers. What it does is that it publishes XML messages to a Tibco EMS topic on a EMS server deployed in same data centers on-prem. Few Java applications which are deployed on different VM's subscribe to this Tibco topic and pull messages and process them. This is the legacy flow.
As a part of modernization GCP is coming into the mix. Now the scenario is that XML messages that On-Prem .Net application publishes to the Tibco topic should also get pushed to pub/sub resource topic on GCP cloud. A Java microservice which has been deployed on GCP infra would subscribe to this topic and consume these messages from it.
Now the problem I am facing is that how to go about this integration between On-Prem and Cloud applications. I thought about a couple of options.
Copy the messages directly from legacy Tibco topic to which .Net app publishes messages to Pub/sub topic in GCP. I am not a Tibco expert and not sure If this is supported. I found the below link but not sure if this suits my use-case. Also client wants to move away from Tibco and not sure if the legacy Tibco EMS on data centers support the below Tibco connector feature.
https://www.tibco.com/connected/google-cloud-pub/sub
Make changes to the .Net code base so that point in code where it publishes message to Tibco topic we can add additional code to also publish it directly to Pub/Sub topic in GCP. Not sure if this is ok as .Net application is on legacy on-prem VM and the Pub/Sub is in the Cloud. Here also I not familiar with .Net but found out that there are .Net Google client library which can be added in .Net code to achieve this flow. Also is Google Pub/Sub the right integration tool to be used or something else has to be used to connect these two systems to-gather.
This is by far i could proceed. Could you guys let me know are the above 2 approaches right or there is an issue and which one is the right approach. Also if there is any other solution apart from above it would really help me to move forward. Hoping for a positive reply and help from you all.
Thanks, Vikeng21
For the 1st scenario the mentioned connector is in fact a TIBCO BusinessWorks plugin. So the approach would be to build a kind of GCP Cloud Messaging / TIBCO EMS gateway using TIBCO BusinessWorks. It would be then possible to run this solution on premise or in the Cloud (using TIBCO TCI offering).
The advantage of this approach is that it would be transparent for your applications and local .Net applications and Cloud applications would receive exact same messages.
I think EmmanuelM's answer covers the first scenario, it would probably be the easiest and most transparent approach.
In regards of scenario #2. I think this is a valid approach as well, although it requires to modify your application code to publish messages to Pub/Sub alongside Tibco, I'm no Tibco expert either; but when it comes to Pub/Sub, as you've mentioned, Pub/Sub offers a .NET client library which you can you use in your application to easily publish and consume Pub/Sub messages. I see that you've mentioned:
Not sure if this is ok as .Net application is on legacy on-prem VM and the Pub/Sub is in the Cloud
It is completely ok; Cloud Pub/Sub service is used through its API, and you can consume the API regardless of whether you do it on-prem or cloud.
The thing about this approach is that I'm not sure how consistency could be kept between Tibco and Pub/Sub, I'm assuming that this is why the first approach would be easier and transparent as this is probably what the integration plugin is in charge of. Without that, some custom application logic would probably be required to guarantee that messages are being successfully published both to Tibco and Pub/Sub.
Having said that, I would really recommend that you get in contact with Google Cloud Sales to describe in detail your use case, business requirements and get personalized assistance for your migration plan.
we have application(Java based) on which other 8-10 application are dependent.
They are connecting to different Queue/Topics etc to our application.
Many times these queue/topic names get changes and other teams are chasing us for the changes.
So I am working on creating standalone application , which will invoke restful APIs from WebSphere using Java and will provide them details to specific environment(using some simple UI). (I don't want to use database to store queue/topic details which is manual work . Wanted real time Queue/Topic details from IBM WebSphere ,which is hosted in our environment)
I checked IBM WebSphere documentation but didnt get what I am looking for.
Also if there are any APIs for such , how I can authenticate that API (will there be token etc)
Thanks in advance.
WebSphere does not have REST api for this. You need to write your own java application that will connect to Websphere's Deployment Manager (dmgr) via SOAP and query for MQ , and then expose via REST.
See for jython example... https://www.ibm.com/developerworks/community/blogs/a9ba1efe-b731-4317-9724-a181d6155e3a/entry/JMS_queues_monitoring_scripts_provided_by_WebSphere_Level_2_support?lang=en
To list the Queues / Topics that are defined in a WAS server, one way to go is to use JMX and MBeans, ie write a program that will initiate a JMX connection, locate the SIB running in WAS, retrieve the MBeans associated to the Queues/Topics and request detailed information on them
For this, you can also use a tool like JMSToolBox that does exactly that (and much more)
(To be fair, I'm the author of JMSToolBox..)
We're starting work on a monitoring application that will be providing status for several pieces of hardware. The data will be updated on an Oracle DB by a backend process, this application will have to be developed in Java and deployed on a WebLogic 12c application server stuck behind an Apache HTTPD server.
Since the monitoring will be real-time, we'll be needing almost instant refresh of the data that was added on the database. To achieve this, I've been doing some tests with the following frameworks:
Hibernate as ORM.
Spring 3.0.5.
JSF 2.2 and PrimeFaces 3.5 with PrimeFaces Push (Uses Atmosphere).
My tests were successful and I was able to get something working quite quickly. However, I've noticed that Atmosphere has some potential that is being contained by the PF implementation, also, I don't know if this is the most lightweight solution.
Because of this, I wanted to ask you if you guys had any other approaches for this solution, i.e:
Spring MVC + Atmosphere.
Other MVC + Other Comet/WebSocket framework.
Most of the data shown will be for charts, tables and maps. The biggest limitation will be that everything must be Java compatible, since the application server won't be changed.
To summarize, my question is:
Which alternative options do you suggest for this project based on the requirements and limitations I established?
Let me know if you need additional information.
Spring 4 has good Websockets support, have a look here at the documentation. It makes possible to create a websockets endpoint, and use it in a publish-subscribe model based on the STOMP protocol.
This protocol is a messaging protocol that allows to subscribe to a topic and receive notifications, publish to a topic to all subscribed listeners or send a server push message to a single client.
Currently Websockets might not work for all users due to browser limitations, proxies that are not configured to forward the upgrade headers needed to upgrade from HTTP to Websockets, or network elements that timeout long-lived connections.
Spring 4 provides good support for this via SockJS, which has transparent fallback capabilities (to ajax, iframe) if a Websocket connection cannot be established.
All these things are needed to use Websockets in this day and age, and Spring 4 provides a complete out-of-the-box solution.
Have a look at this blog post to see how lightweight this solution is, specially if used together with Spring Boot.
If it's a frontend intensive application you might to couple Spring 4 with AngularJs, for frontend widget development. But Primefaces is a great solution, if the widgets they provide suit your needs it would spare a lot of work.
I've seen a bunch of screencasts demonstrating the integration between blazeds and flex, also some lcds tutorials, model driven or not.
I've seen that some of them the presenter opens 2 browsers and once you change one value in a grid, it propagates to all other grids that presents the data.
I am wondering how the heck this is done, and how to reproduce.
Does this feature depends of the Edge / LCDS solution? I don't think so, but I've never seen some code explaining about it.
I feel it may or may not rely on JMS / MQ / messaging protocols or if this is some sort of 2 way sync and propagation of collection between instances of the same service result.
Thanks for any inputs.
Cheers,
Ernani
You can implement this feature both with BlazeDS and LiveCycle Data Services. BlazeDS provides remote and messaging features (the messaging features is the one allowing you to synchronize the data between the clients), LCDS extends BlazeDS adding new features like data management (productivity improvements), PDF generation, EDGE server for dealing with DMZ zones), MDA development, portal integration etc. It also adds some advanced messaging features like message conflation, throttling, reliability.
BlazeDS is free and open source and in my opinion a robust solution, you can use it if you want to synchronize the data between clients. LCDS adds a lot of things, but the LCDS customers should have a large budget.
How does it work? There is no JMS behind for this feature (however BlazeDS can integrate with a JMS provider so you can have one client in broswser and the second one running a SWING application). Instead there are some message queues on the server and a publisher - subscriber graph. In order to push the data from the clients to the server there are several choices, the more advanced are available only on LCDS: HTTP polling, HTTP long polling, HTTP streaming, RTMP sockets (LCDS only). All of them are described in details on Damon blog.
If you want to see some code go and download BlazeDS and take a look on the samples, there are several ones showing the messaging features. Also there a tomcat server is bundled in the download, and the samples are already deployed in it.
To do this you need to keep an open socket connection between the client and the server so that the server can push data back to the client.
I believe that the RTMP protocol was used for this two-way communication.
I understand that this is the primary reason to use LiveCycle Data Services over BlazeDS. WebORB also has push functionality, as does GraniteDS. I've also seen demos where this is done with ColdFusion.
If none of those options are available to you, you're stuck doing some kind of polling to the remote server.
Unfortunately, I do not have specific code samples to share.
A simple sample showing how to do this using WebORB can be found here:
http://www.kensodev.com/2009/11/01/synchronize-client-application-using-flexweborb-net/
That sample is based on WebORB 3 for .NET; WebORB 4 is now available, for both .NET and Java.
Point being: This is brain-dead simple using WebORB, which is FREE (although a paid Enterprise version is also available). God forbid that anyone should shell out $30K for LCDS just to get this feature.
--- Jim Plamondon, Midnight Coders (makers of WebORB)