I am new to programming and working on SIP applications. I am bit confused about where to deploy SIP applications. I read about HTTP Servlets, which are deployed in servlet container, I believe Tomcat is one Servlet container.
Basically, I have few questions and understanding:
Container manages the lifecycle of the servlets and if I just get the servlets api jar and deploy it with my application it will not work?
I found SIP servlet API and there's also Mobicents SIP servlets. Are they different?
Can I deploy my SIP servlet application in Tomcat along with the API jar?
Is Mobicent a container for SIP servlets like Tomcat is for HTTP Servlets, but Mobicents also has Tomcat.
These are very naive questions but I tried to find out the answers myself and was not successful. I am not from programming background so having a difficulty to understand the things.
Thanks
I invite you to read the specification at https://jcp.org/en/jsr/detail?id=289 it's not a complex read and will give you a good idea of what you can do. SIP servlets are built off the generic servlet API provided by the Java Servlet Specification but differ from them in a number of ways notably on being asynchronous or being able to generate multiple responses to an incoming request
the SIP Servlets API is defined by the Java specification mentioned in 1. above. Mobicents SIP Servlets is an implementation of the SIP Servlets API specification. It is supported by TeleStax. This is very similar in concept to JBoss Application Server (aka Wildfly) implementing the Java EE Specifications and being supported by Red Hat.
Please download the latest version of Mobicents SIP Servlets on Tomcat. It comes with a couple SIP Servlets application by default. You can also check out the examples, that should give you a good sense of how things are working together.
the SIP Servlets specification mandates convergence of SIP and HTTP so that you can use both in your application and share data between HTTP Sessions and SIP Sessions to create converged applications leveraging both the Web and the VoIP worlds. As such Mobicents SIP Servlets extends Tomcat to provide SIP capabilities to it. So a vanilla Tomcat installation will not support SIP Servlets out of the box, you need to download the specific extended Mobicents SIP Servlets Tomcat Version to be able to use SIP Servlets.
There is no naive questions ;)
Related
Our organization is looking into implementing new internal APIs using GRPC.
Currently, we have a microservice that is serving internal/external requests using embedded Jetty. We want to make internal communication between services to be done over GRPC.
So, we'll have 2 servers running on the same VM: jetty and GRPC. Is it a good practice, any red flags with that approach?
We do not want to split that said microservice into 2 to save costs. We should be able to run the app on the same number of VMs.
There's nothing inherently special or wrong about having Jetty and gRPC in the same JVM. The main point of potential trouble is just that you will have two ports exposed instead of one; that might matter for service discovery or firewalls.
I am planning to use Apache HttpClient with BasicHttpClientConnectionManager on a TOMEE stateless bean to perform HTTP GET/POST/DELETE requests to a remote server. Are there any gotchas with this approach ? Does HttpClient spawn new threads that negatively impact EJB container?
Are there any other alternatives? How do you usually perform http request from your webserver to other servers.
Since you are using Tomee you can use the JAX-RS client builtin to Tomee. You can find more information on it in the Java EE tutorial (chapter 30) here.
e.g.
Client client = ClientBuilder.newClient();
String name = client.target("http://example.com/webapi/hello")
.request(MediaType.TEXT_PLAIN)
.get(String.class);
I have written http client using camel http connector. Currently JBoss is chosen as my application server. I would like to write a HttpService that should run on JBoss which can receive and process the payload from client.
Any pointers would be much appreciated.
Thanks in advance
You can have a REST service running on the Jboss server which can be easily built using jersey or resteasy frameworks. Other REST libraries can be used too.
The http service can be built using the plain servlet too. But REST libraries provide a lot of builtin support.
I am writing a server which is used to provide service using http protocol. (The server is not designed to be accessed from broswer, it's used to provide data for iphone client) I know cxf library has good support for this. Is it possible to do this without tomcat.
If possible, a sample project or sample config file would be great.
(I think the question could also be understood as do we have to use the web container like tomcat for http protocal)
Thanks
You don't need to use tomcat. CXF has an HTTP transport that uses an embedded Jetty instance to provide HTTP server support for the case where you don't use Tomcat or other servlet engine. Almost all of the sample applications that CXF ships in the samples directory use this when you use the -Pserver maven profile.
I'm developing a server to offer persistence to clients connecting through http. The clients will be based on different technologies: web, iphone and android; that is why I thought of using http in the first place (may be there is a better approach).
In the server I'm using a javaee 6 implementation with EJBs and JPA to achieve my persistence goal and servlets to offer access to the EJBs interfaces to the clients.
The servlets are just dummy proxies, so I'm sure there has to be a framework or a better way of offering my EJB as a service to my clients.
I'm trying to find a way of avoiding all the dummy proxy servlets.
You could implement RESTful Web Services with JAX-RS