I'm writing an application that runs as a daemon and makes restful request periodically, I'm trying to implement a system where I have another application (preprocessor) that will be sent the JSON responses from the daemon.
My plan is to use JMS for this, my understanding is that I can send the restful responses I receive in my daemon.jar to a Queue using a JMS provider, I've been looking into using JBoss.
So my understanding now is that I need to run a JBoss 7 Application server, or a Wildfly AS, I plan to run this server on a raspberry pi 2 for testing purposes, Have I got this right?
Regarding the client and receiver, Do they both need to be running on the server? I'm confused by this, can I have the Wildfly AS running on the pi, have the sender running on another machine and the receiver running on a 3rd machine?
Do my sender and receiver need anything specific on them to communicate with the AS other than maybe some libs for Wildfly?, I've seen Hornetq mentioned a few times, but am unsure how this fits into the process.
Finally got this working, I couldn't find a start to finish example of setting this all up, but managed to piece it all together from different examples.
the Sender(Producer) and Receiver(Consumer) don't need to be running on the server, I have all 3 running on different machines, they have to know the address of the Wildfly AS and the name of the queue(HornetQ) they are connecting to.
Related
I'm trying to create an app with notification service whenever a call is made on API.
Is it possible for me to create a logger on port:8080 and when app is run on the server it listens to api running on another server.
Both applications are run on local machine for testing purposes using Docker.
So far I've been reading https://www.baeldung.com/spring-boot-logging in order to implement it but I'm having problems with understanding the path mapping.
Any ideas?
First let's name the two applications:
API - the API service that you want to monitor
Monitor - which wants to see what calls are made to (1)
There are several ways to achieve this.
a) Open up a socket on Monitor for inbound traffic. Communicate the IP address and socket port manually to the API server, have it open up the connection to the Monitor and send some packet of data down this "pipe". This is the lowest level approach simple, but very fragile as you have to coordinate the starting of the services, and decide on a "protocol" for how the applications exchange data.
b) REST: Create a RESTful controller on the Monitor app that accepts a POST. Communicate the IP address and port manually to the API server. Initiate a POST request to the Monitor app when needed. This is more robust but still suffers from needing careful starting of the servers
c) Message Queue. install a message queue system like RabbitMQ or ActiveMQ (available in Docker containers). API server publishes a message to a Queue. Monitor subscribes to the Queue. Must more robust, still requires each application to be advised of the address of the MQ server, but now you can stop/start the two applications in any order
d) The java logging article is good started into java logging. Most use cases log to a local file on the local server. There are some implementations of backend logging that send logs to remote places (I don't think that article covers them), and there are ways of adding your own custom receiver of this log traffic. In this option, on the API side, it would use ordinary logging code with no knowledge of the downstream consumption of the logging. Your monitor app would need to integrate tightly into a particular logging system with this approach.
I want to write a TCP/IP Socket based application using Java Spring/Spring Boot framework. However I am facing problem in bringing the TCP server up. Whenever I init the application it brings the tomcat up instead of my tcp server port. My requirement is that the my application will act as a TCP server/client based on the configuration and will connect/accept connection from Third Party. It shall process the requests and send responses back. The application needs to receive/send stream of bytes.
I tried googling a lot and found a few articles indicating implementing a CommandLineRunner interface of SpringBoot however that also did not work. Could you please assist on this
I premise that I don't know a lot about DataStage.
I just know that somebody else has created an "ETL job" and I need to launch it from my Java program, that acts as a client.
How should I do?
Edit:
The DataStage server is phisically different from the client where the Java program runs. I am not allowed running commans on the DataStage server. I need to connect via network. I imagined that DataStage provides some kind of network protocol, or webservice, or something so.
You can use the dsjob command - details see the Knowledge Center
Edit:
dsjob needs to be executed at the server.
You could use a insert into a database table from remote and trigger something (i.e. a UDF) that executes the dsjob on the server.
Alternatively use the WaitForFile stage and transfera file to the server.
I have a problem with an application in Java.
This application uses Apache QPid broker (6.0.1) to send messages.
I run it on 2 computers : the computer I use to work, and the 1 we use to test application before we give it to the client.
On my computer, there is no problem, the application send or receive messages.
The problem is we the other computer. I installed qpid the same way i did on mine : I extracted the .tar.gz, set $QPID_WORK to the working directory, and set ports i use with web management interface.
I tried it yesterday morning, and no problems, all works fine.
But after that, I stopped qpid (my boss asked me to show her how to start every components of the application) and since i can't send messages anymore.
I tried 2 applications :
The first one is the application I work on. The first thing it does is connect to qpid with JMX/RMI (with the apache API). But i have a timeout exception at this moment.
The second application is an app I did to test QPID and see how i can send a message. I also have a timeout exception when i try to send the message.
With the second application, QPID detect the connexion (and display it in web interface) but it doesn't create the queue or put message if it already exists.
I think this is a configuration problem (maybe access rights on a file?) but i'm not sure, and if i'm right, i can't find where is the problem.
I wanted to try to send the message from my computer on the qpid on test computer, but there are not on the same network, and i can't test that :(
Does anyone have an idea of what is wrong?
ps : i apologize for english mistakes, i'm french
ps 2 : i can't show you code exept the one i created to try qpid, but there is nothing really interesting (I took a big part of it from apache documentation with just a few modifications that work on my computer)
The connection with RMI makes a timeout like the message producer.
I found a solution :
the overflow on the exchange was set to 0 (unlimited) but if I change (like 10MO) it works without timeout.
But I still don't know if it's a qpid bug, or a problem with the computer, I'll try to find out with the system administrator and i'll post here if we find an answer if someone else have the same problem.
I have created one sample chat application. In that chat application, I used JApplet and front end.
Till now I was testing my application in my desktop. It is working fine. Now I want to deploy my application over any webserver.
Now I have a few questions. Currently I am using Server socket as 8989 in my chatserver. When I was testing the application in my desktop, I used to start the server as stand alone.
What are the steps I have to follow when I deploy the application over tomcat or any other web server? Which port the client will listen?
How do I start my chat server? I am new to the socket concepts.
when you say you are hosting on the webserver, i believe that its an servlet/jsp based application , which will listen to your requests , in that case the listener will be invoked at the webserver default port either 80 / 8080 (being default). In case you want to change or check , you can go to the TOMCAT_INSTALLATION_DIR/conf/server.xml and check for tag containing the port number for weblistener, and change it to whatever value you feel like.
if thats not the case and you have your own thread which opens a socket for you , you really dont need a webserver, all you need is a host machine which will start the socket listener ( your custom) and then it will listen at the port that you have configured it to be at.
As far as I got it, you're having standalone application as a server, where you handle connections to particular port.
I think there is some confusion that should be clarified.
The very basic question is:
Why do you need your chat server to be running on the web server?
This should be clear to you prio to any later steps.
As web server is there basically to handle HTTP/S requests and that's not your case, as far as I got it. As you're probably running socket TCP/UDP communication.
For the web server however your client applet implemnentation could benefit of. If it would be referrend on a simple html page (deployed inside war) it could be simply redistributable to clients via url call in a web browser.
Maybe I'd preffer to use HTTP + JSON commununication, where you could benefit from web server usage (also on the server side) and would not need any other ports than standard ones.
Not sure if it still makes sence to answer your questions as it might be irrelevant for you, but let's see.
Answers to your questions:
Basically you need war archive (rather than jar one), as that's the one accepted by web servers. once you create it (you need to follow the correct folder/file structure inside) your app could be deployed to web server.
Which port the client will listen? Basically server is the listener here => no client port listening here.
This depends on your communication implementation decision. If still sticking with TCP/UDP one, I don't think web server would be beneficial here.