programmatically get server load information from Apache ServiceMix using JMX - cxf

Is it possible to get the server load information of a webserver deployed on a ServiceMix / Fuse ESB.
I dont want to use Jconsole but get the information by running a java file and writing the values into text file.
Could someone point me to some code that I can run on my machine?
Cheers,
Kunal

You can also intall jolokia i ServiceMix which exposes a REST interface over JMX. This makes it much easier for non Java developers and programming languages to access the metrics. It's just a HTTP call to get the data.
http://www.jolokia.org/
We use this library for the http://hawt.io management console so we can get the data easily from a moderne HTML5 web console.

I won't write the code you ask for, but..
Everything in JConsole is accessed through JMX. And everything in JMX is accessible via code as well (basic tutorial here).
So just locate the value/values you are intressted in using JConsole, then just extract them using the JMX api in code.

Related

SSL (HTTPS) support in functional web framework

How am I supposed to to configure SSL for a Spring Boot Service using the functional web framework?
The configuration via setting server.ssl.* properties does not work (meaning nothing happens at all) and if I am reading the docs right, only server.port and server.address are supported.
As runtime I prefer netty, but I would be fine with tomcat as well.
Indeed, using the server.ssl.* configuration keys is the right way to go. This is not yet supported as of Spring Boot 2.0.0.M5, but it will be in a future Milestone version (you can follow issue #9431 for that).
You could use customizers as a workaround; Spring Boot provides a few of those for Tomcat already (see TomcatConnectorCustomizer), but unfortunately not yet for Netty (see #10418).
In the meantime, you can provide your own ReactiveWebServerFactory bean and manually set up your Netty server to do that.

Which Java EE container works for Apache Camel/CXF/ActiveMQ web applications using EJBs?

The Camel web page says
The following projects can leverage Apache Camel as a routing and mediation engine:
Apache ServiceMix - a popular distributed open source ESB and JBI container
Apache ActiveMQ - a mature, widely used open source message broker
Apache CXF - a smart web services suite (JAX-WS and JAX-RS)
Apache Karaf - a small OSGi based runtime in which applications can be deployed
Apache MINA - a high-performance NIO-driven networking framework
However, I would like to run Camel inside a Java EE web application and have access to web services, JMS, and EJB (CDI, message driven beans, JPA, etc.) Preferably using an open source Java EE server.
If I recommend this to my company, then then all the usual Java EE wizards such as wsdl2java need to work out of the box. There also needs to be documentation and tutorials so we can hire people to jump in and start using it.
Glassfish failed across the board. The wsdl2java wizard for CXF fails using the Glassfish runtime classes (I ran it manually and hacked my code tree.) There is no documentation nor any tutorials for wiring in OpenMQ (and google searches on the topic are discouraging.) Simple library-only samples run fine, of course, but without having ActiveMQ as the native JMS it seems to be a dead end. CXF integration seems unworkable as well. My first attempt at copying a WS sample complains "No component found with scheme: cxf" which appears to be a bundle or classpath issue.
I'm starting to think I should go back to ServiceMix and drop back to servlets without EJBs and CDI, even though I really hated not being able to use Eclipse gracefully for edit/compile/debug (you pretty much have to build and run from an outside DOS prompt window and remote debug in.)
You can use Apache Camel with any container of choice. We try to not have any restrictions or barriers. You can also run it standalone. The web page just mentions some of the containers you can use.
Apache Camel is just a bunch of JAR files you can deploy and use in any container of choice. For example with WAR files you can deploy to Tomcat, TomEE, etc.

Apache camel jcr

I am new to camel as well as JCR's.
I am trying to connect to Liferay's content repository using the JCR component in Camel. What I am trying to achieve is pass a content id explicitly and using Camel, I want to hit the content repository of Liferay and retrive the relevant data.
I am trying my hands at the fuse IDE tool as well to get this done.
What I have managed to do so far is configure the endpoint uri to hit my repository. Not sure how to proceed further. Havent found much info on implementations
with Camel JCR.
Any pointers will be of great help!!!
Did you have chance to check out this wiki page?

How to setup Adobe Flash Media Server 4.5 with external Apache

I'm trying to setup Flash Media Server with an external Apache in order to stream some vod content in a HTML5 video Player in chrome browser.
I've followed the instructions Adobe Help but that doesn't help much. I can see FMS and FMSHttpd services running in the services list.
Normal html pages display fine, however, the video is not streaming.
I don't want to use the Apache that comes in the same package.
I'm streaming it to a html5 video element and the code goes like this in html
<video controls="controls" autoplay="autoplay"
src="http://localhost/vod/sample2_1000kbps.f4v" width="480" height="352">Video Tag not supported</video>
The FMS and Apache both are in a windows machine, but in different locations.
The video plays fine when I use the Apache of the FMS Package.
I know i might have made a mistake in several places in this complex setup, however, any help will be appreciated.
Thanks in advance
Make sure you are attempting to use Apache (even one you install yourself). Using another web server like IIS will not work.
Can you request the URL directly? http://localhost/vod/sample2_1000kbps.f4v. You will need to make sure that the manually installed Apache is configured to look at the correct location on disk, where the file is actually located.
That URL looks like you are trying to progressive download the file. FMS is not involved in this at all. Can you explain what you are trying to achieve in more detail.
If you are not using the Apache installed by FMS you should not even see FMFShhtp in the list of services.
Stop fmshttpd. in your manual Apache httpd.conf make sure that DocumentRoot is pointing to the correct location where the vod/sample2_1000kbps.f4v file is located. Start the manual Apache. Request the file. What is in the Apache access/error logs?
Why do you not want to use the Apache shipped with FMS?
i guess i have figured that out. built in apache was listening to port 8134 instead of default 80. so when i put the URL as computername:8134 it all worked fine.

How do I access the app engine admin interface when loading jetty in the Clojure repl

Is there a way to get to the admin interface if I'm not using the dev_appserver.sh script and instead loading up jetty myself?
I'm doing this so that I can use the Clojure repl during development. While my application works as expected, there is nothing handling the /_ad/admin requests and so I can't get to the data store viewer or look at other admin stuff. Here's how I'm loading up the server in the repl: http://gist.github.com/491868.
I need to manually bind the handler for that route, but I'm not even sure what the handler is.
There is a difference between the jetty application and the jetty library (my distinction)
The Jetty application knows how to read a config file, host servlets or WAR applications. This is similar to tomcat in that it provides you an admin interface with which you may interact with the jetty application, ie deploy applications to it.
The way you are using is via the API. In this mode you are responsible for defining routes and handlers for requests etc. This is a low-level approach suitable for simulating the Google App Engine environment (in fact, the GAE client-side mode does run on jetty). It doesn't include the admin interface you speak of since it is running in an environment (yours) with which it is unfamiliar and is not suited for.
You will however be able to do anything you could do in the web interface with api calls directly.

Resources