How can I convert a standalone Scala application to runnable SOA? [closed] - java

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I am working on a scala-spark application which I would like to migrate to the runnable service model.
For the application could be invoked but I would like to run the application as a service which could be stopped and stopped from a Unix/Linux command.
Also, deploy the application on webserver and build Rest APIs.
Would writing a wrapper in Linux/Unix make sense to run it as a detached daemon process?
Can someone guide me what is the right tools if any which could help me in rapid development?
Thanks,
Az

You could :
embed a REST API or whatever service you want into the driver
use the livy project as you can see in the paypal presentation ["spark compute as a Service"][1] https://spark-summit.org/2017/events/spark-compute-as-a-service-at-paypal/
As for start stop restart and so on you need to track the applicationid to kill (assuming you are using yarn)

To be stopped and started, you could use the thrift server and feed in straight SQL commands. You could run a spark job that opens a listening port as well, which is what Zeppelin does.
To deploy the application it depends what language you like but you could use flask with Python or Play with Scala.
Also, you might want to look at Zeppelin, you can write the jobs on notebooks and then use the Zeppelin API to pipe in http requests. Actually if you go this route, I'd be interested to look at your web service client because I'm goinng to be doing the same thing
https://zeppelin.apache.org/docs/0.7.0/rest-api/rest-notebook.html

Related

What is the best approach in java to call a C function running on another server? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
What is the best approach in java to call a C function running on another server? My application written in Java and running on an application server on server 'A' and I need to call a C function running on another server 'B' that doesn't have java installed.
Should we build a web service on server B to accept requests from my Web application on server A? or just call it remotely using RPC? and what is the performance of both?
First of all:
Just call it using RPC
There is no such thing as "just" when talking RPC. Unless you already have some CORBA or whatever solution in place, you will have to invest a serious amount of time to get this working.
Using a web service adds multiple layers of abstraction, which can affect latency. But of course, that is the more flexible solution.
I think it is fair (in 2018) to state: a reasonable architecture would provide some sort of (restful) HTTPS service on B. You should only look into other options if there are hard pressing reasons.

Is it possible to register a Domino Server with the Java API or C API? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
We are well on our way to Dockerizing Domino. In fact, we have a Domino Docker running in IBM Cloud (bluemix) that replicates with on prem.
What we want to be able to do is automate the standing up of a Domino server.
In our script, we are thinking of calling a custom program we can build that will use either the C API or Java API to register a new server, deploy a XPages (JSF) application to it, and start the server, replicate over the common user directory (names.nsf) from the master server.
Currently, we started the Domino Container in CentOS in listener mode. We registered the server on prem, and copied over a bunch of files (server.id is one of them) and edited confirmation to manually configure it. We want to automate this process.
Any insights on how this can be better accomplished? any api references you can share to get us most of the way there?
Yes, this is possible. We have done this in Lotusscript using LS2CAPI.
As we are accesing API functions, this is also possible using Java. Not sure, if domino-jna already includes the needed Api calls, but this can be implemented. Take a look at github for Karsten Lehmann and domino-jna.
domino-jna can be used from XPages as well.

How to run java files in a web server [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
i am creating an android application which has got two parts a client part and a server part. So the client will be asking the serveer for a particular data and server need to give it back to the client. My question is how i can run this server program (jar file ) in a web server. I have tested it locally using eclipse but i need to know how i can put this into a web server and run it there. So that the client can use a data connection and connect to the server program and get back the respose from there Sorry for the inconvenience caused and a thank you in advance
From the way you describe your server it sounds like a simple .jar file that you built. If this is the case, you can simply deploy the jar on any compatible computer (or webserver) that you have shell access to.
Build runnable jar in eclipse
Place the jar file on some server
Make sure the server has java installed (same java you used to build your runnable jar)
Run the jar using java -jar path_to_jar.jar
To answer your question, you can run this in the background of a server running other services as long as you pick a port that isn't already in use. Make sure you enable port forwarding on your router/firewall (if you have one) if you want to access the service externally.
You will require Tomcat server for running Java ,jsp
To start with hosting this link might help you.
How to host a JSP website on a webserver?

Run non GUI Java program on Server [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I'm really experienced when it comes to Java SE, but aside from helping out on a Java EE program running on a application server like JBoss i have no experience in running Java server side, only PHP applications.
I want to do the following:
I just want to write a Java program, that listens on a port (if there are incoming connections) which has to run on a server. It's no web application, there's no GUI or any stuff like that. It just needs to be approachable via the net from for example a desktop application.
What do i need to run a simple Java program server side which can accept requests as simple as possible? (Server recommendations for this simple task appreciated).
If you don't need the full stack of webserver, no. You just need the capability to run a java process.
Check the API for
ServerSockets http://docs.oracle.com/javase/7/docs/api/java/net/ServerSocket.html
and
Sockets http://docs.oracle.com/javase/7/docs/api/java/net/Socket.html
which will just allow you to open a specified port and do with it as you please.
it's really simple with an embedded jetty server. As simple as:
Server server = new Server(8080);
server.start();
server.join();
You just need to implement a handler.
public class MyHandler extends AbstractHandler{...
and add it
server.setHandler(new MyHandler());
see http://www.eclipse.org/jetty/documentation/current/embedding-jetty.html

Monitoring application-specific metrics using JMX and Hyperic [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
My webapp exposes some application-specific metrics (think "orders placed") via JMX, which I'd like to monitor using Hyperic HQ (open source edition).
According to the Hyperic Inventory Model, my Linux server is called a Platform hosting my Tomcat 6 Server, which in turn hosts Services (e.g. "Servlet Monitor") that finally expose Metrics (e.g. "Error Count per Minute").
I assume I need to develop a custom Hyperic plugin (just an XML file, really) that would point the agent and server at the correct JMX MBeans. Ideally, I would like to see my webapp listed as a Service hosted by the Tomcat 6 Server, but looking at the Plugin Development docs, that doesn't seem to be possible.
Maybe that's not too bad anyway, because in theory, I might want to switch my app to Jetty. But I figure that's a very common use case, so are there any best practices? I couldn't really find any examples of this on the web, so I thought I might just ask the experts..
Please note: The Hyperic docs I linked to seem to require an account to view.

Categories