First, you need to find the PID of your process, which you can find by using the "ps" command as shown in the previous question. Once you find the PID you can use the "top" command to find the CPU and memory usage. Alternatively, you can also use the prstat command as shown here.
Posted Date:- 2021-09-16 10:04:51
Though both httpd and Tomcat are products of Apache software foundation, the httpd is more popular and used across the web and not just in the Java world. The httpd is a web server that can serve static HTML files and dynamic content using PHP, Perl, or Python, while Tomcat is a Servlet container that provides the runtime environment for Servlet and JSP. You can also use both Apache httpd and Tomcat together in Java world.
Posted Date:- 2021-09-16 10:01:55
This messaging question is normally asked at the start of the interview, to get an idea of whether you have practical experience in JMS or not. If you have used JMS then, it must be via a JMS provider like Websphere MQ from IBM or Tibco EMS. You can answer this question based upon your experience with a particular JMS Provider.
Posted Date:- 2021-09-16 09:59:22
Well, large XML messages really consume a lot of bandwidth, when they are transferred from client to broker (JMS Provider) and further from broker to recipient. You can reduce this bandwidth by compressing messages before sending it on the client-side.
Since XML messages compress a lot, it's worth doing at the client-side with the expense of some CPU time. Java even provides a compression facility in form of java.util.zip package. But remember that compression and decompression on both the sender and receiver side must use the same algorithm.
Also, If you are using the PERSISTENT delivery mode, then messages are persisted on the server-side, before delivering to consumers, compressed messages take less time and space on the server-side during persistence.
Posted Date:- 2021-09-16 09:58:29
JMS Selector is a filtering facility provided by JMS Provider or broker. Suppose a client is only interested in listening to some specific messages and not all traffic from Server than it can either filter messages upon receiving, or it can use JMS selector to do the filtering on Broker itself. JMS Selector allows you to specify filtering criteria in the form of String, which is a subset of SQL conditional expression.
For example, if you are interested in messages which are for stocks starts with A, you can specific condition as SYMBOL like "A%", where SYMBOL is a user-defined Message property set by Sender.
Posted Date:- 2021-09-16 09:57:43
A Session object in JMS is a single-threaded context for creating message producers and consumers. It's not thread-safe, and not advised to share among multiple threads.
Posted Date:- 2021-09-16 09:56:58
If an EJB component-based application is deployed on any application server cluster, then it can be configured to run on any server inside the cluster to provide availability and scalability for the application.
If an EJB is in the form of Message Driven Bean (MDB), then it can run on any server inside the cluster and can be initiated parallel to a number of application servers in the cluster.
Posted Date:- 2021-09-16 09:54:56
Glassfish server is actually an application server and can be also used as web servers which means it can handle HTTP requests from the web browsers.
As an application server, it is developed to handle all types of Java Enterprise applications in terms of servlets/JSP and also EJB components.
Whereas, Tomcat server is actually a servlet container that is generally used for handling servlet or JSP components.
Posted Date:- 2021-09-16 09:53:28
The encryption and decryption of the messages is handled by JMS provider and not JMS specifications. Sonic MQ by Progress Software is a leading JMS provider and they do encryption through encryption mechanisms called Quality of Protection.
Posted Date:- 2021-09-16 09:51:54
First of all, after receiving the message from Topic or Queue, the message has to be converted into a non-java client according to their specification. The message once converted to non-java client, it can be delivered.
Posted Date:- 2021-09-16 09:51:15
The MOM ( Message Oriented Middleware) is a software that works as an intermediate between two communicating components. It is placed between the client and server, MOM provides the facility of passing message by using the technique queuing. Until the client does not request to read the message, the messages will be stored in queue. By using this technique, the software component can work independently of time.
Posted Date:- 2021-09-16 09:50:34
A durable subscription is created by the subscriber to ensure that it receives all the messages published by the publisher, even during the period when the Receiver is inactive or down. JMS Provider or Broker will retain all messages published by a publisher for a durable subscriber until messages get acknowledge or expired.
Posted Date:- 2021-09-16 09:49:08
As we have previously discussed the concept of the queue, where the message is stored until the receiver receives it. The functionality of browsing the messages in the queue and displaying the header values is supported by the QueueBrowser object.
One can create a QueueBrowser object via. JMS session.
JMS Queue Browser
Posted Date:- 2021-09-16 09:48:26
The JMS client is basically a component written in the Java programming language which is responsible for invoking and consuming message bodies.
Posted Date:- 2021-09-16 09:47:38
Message Listener is typically used with message consumer in the case of asynchronous delivery. For asynchronous delivery one can register an object of MessageListener with messageConsumer.
Posted Date:- 2021-09-16 09:47:00
If JMS Session is transacted, in which case it returns SESSION_TRANSACTED from getAcknowledgeMode(), acknowledgment mode is ignored.
In transacted sessions, commit() and rollback() methods are used for committing receipt of a message. A call to commit(), confirms receipt of all messages on that session.
Similarly, if an Exception is thrown from onMessage(), it would be considered as rollback, and the message will remain in Queue for delivery.
Posted Date:- 2021-09-16 09:45:55
JMS provides different options to guarantee message delivery like PERSISTENT and NON_PERSISTENT deliver mode to guarantee the message is not lost during transportation. IT also provides JMS provider to specify retention policy for Queue and Topic, which can retain messages until it acknowledged or expired, or till certain delivery attempt. durable subscription is another way to ensure your Receiver, receives a message even if it is inactive when the publisher publishes the message.
Posted Date:- 2021-09-16 09:45:00
P2P model is highly reliable and it is used in a one-to-one situation, while subscribe model is used in one-to-many situation. It is very fast but less reliable.
Posted Date:- 2021-09-16 09:44:05
The different types of messages available in JMS API are Message, TextMessage, BytesMessage, ObjectMessage and MapMessage.
Posted Date:- 2021-09-16 09:43:29
JNDI is the Java Naming and Directory Interface. If an application is connected to a database, it allows the application developer to give a name to that database instead of worrying about the database connection credentials.
The JNDI API will access the naming directory and will find the mapping between the name and the database object and connect accordingly. We can use this mechanism while we are connecting to any connectionFactory (queue or topic) for sending messages.
Posted Date:- 2021-09-16 09:43:01
Topic and Queue are two kinds of destination, where a Sender sends messages. in Point to Pointe messaging, also known as PTP messaging, Sender and Receiver communicates using Queue, while on publish-subscribe messaging, also known as pub/sub messaging, Receiver subscribes on a Topic.
The topic is used, when more than one consumers are interested in receiving the same messages. In JMS, both Queue and Topic are interfaces, which extend Destination and subsequently encapsulate the name of the Topic or Queue.
Since Destination is a JMS administrated object, the creation of Topic and Queue is usually governed by JMS Provider administrator. Usually messaging or middleware team, which administers broker, creates Topic and Queue on request of the application team and allows them to access using JNDI.
A JMS client can specify a Queue or Topic name while creating Message Producer or Consumer e.g. by using Session.createConsumer(Destination queueOrTopic) or Session.createProducer(Destination queueOrTopic).
Posted Date:- 2021-09-16 09:42:30
Byte message is a stream of uninterrupted bytes. It contains an array of primitive bytes in its payload. For the transfer of data between two applications in their native format, byte message is used, which may be not possible with other message types.
Posted Date:- 2021-09-16 09:41:31
Byte message is a stream of uninterrupted bytes. It contains an array of primitive bytes in its payload. For the transfer of data between two applications in their native format, byte message is used, which may be not possible with other message types.
Posted Date:- 2021-09-16 09:40:59
Durable subscription gives a subscriber the freedom of receiving all messages from a topic, while a non-durable subscription does not make any guarantees about messages sent by others when a client get disconnected by others.
Posted Date:- 2021-09-16 09:39:23
The identifiable difference between the two models lies between the way in which the message is delivered.
In the case of JMS, the sender application sends the message to the destination application and then it again waits/or processes another message as per the programming criteria.
While in the case of RPC, the thread is completed once the message reaches the destination and the control comes back to the method responsible for message transport.
Posted Date:- 2021-09-16 09:38:12
Specifically, there are two types of model provided by JMS:
Point to Point: As the name itself suggests it is a one to one messaging mechanism, where the sender sends a message to a single receiver. The message is available to the receiver application once it’s ready and until then the message is stored in the queue.
The most important part of it is there are zero dependencies with respect to time between both the sender and the receiver application.
Publish and Subscribe: This messaging mechanism is very uniquely designed by JMS.
For Example, one reader subscribes to one blog where the person is interested. Now there may be several people interested in a particular blog.
And they subscribe/register to that blog. Now once a new post or topic is published on the blog, all the registered readers will get an update. This messaging model is called Publish and Subscribe.
Posted Date:- 2021-09-16 09:05:27
As the name suggests synchronous messaging is synchronous, which means Sender waits for a response from the Receiver, instead of doing anything else. On the other hand in Asynchronous processing, Sender just sends the message and starts doing other things, instead of waiting for a response like maybe send another message. JMS supports both synchronous and asynchronous messaging.
Posted Date:- 2021-09-16 09:04:39
This API provides two types of communication:
Asynchronous: The message will be delivered to the client, it is not required for the client to send requests in order to receive it. The client application will receive it once the sender application transmits.
Reliable: Here the message is sent to the client application once the API protocol ensures the availability of the receiver application.
Posted Date:- 2021-09-16 09:02:00
Java Messaging Service is a Java API, which enables the systems to create, read, send and receive messages.
The most important part of the algorithm is very well structured and allows one application to send a message to another application and also enables broadcasting features to the subscribers.
Posted Date:- 2021-09-16 09:01:11
* JMS provider
* JMS client
* Messages
* Administered objects
* Native clients
Posted Date:- 2021-09-16 09:00:27
The JMS provider handles data conversion, security of the messages and the client triggering. It specifies the level of encryption, security level of the message and the best-data type for the non-JMS client.
Posted Date:- 2021-09-16 08:59:23
Queue technique is used for one to one messaging, and it supports point to point messaging. While topic is typically used for one to many messaging and it supports public subscribe model of messaging.
Posted Date:- 2021-09-16 08:58:57
There are two types of messaging models that JMS provides –
<> Point to point queuing
<> Second one is publish and subscribe
Posted Date:- 2021-09-16 08:58:17
1. Change directories to the server/lib directory. cd WL_HOME/server/lib.
2. Copy wlclient.jar to "weblogic-classes.jar" cp wlclient.jar weblogic-classes.jar.
3. Use the following command to create wlfullclient.jar in the server/lib directory: ...
4. Delete the "weblogic-classes.
Posted Date:- 2021-09-16 08:46:55
For WebLogic Server 10.0 and higher releases, client applications should use the wlfullclient. jar file to provide the WebLogic Server specific functionary previously provided in the weblogic.
Posted Date:- 2021-09-16 08:46:09
jar deployed with the wlclient. jar) , provides Java EE and WebLogic JMS functionality using a much smaller client footprint than the full WebLogic JAR. The smaller footprint is obtained by using: A client-side library that contains only the set of supporting files required by client-side programs.
Posted Date:- 2021-09-16 08:45:46
sql. DataSource) context. lookup("java:comp/env/jdbc/myDataSource"); if the resource reference name is jdbc/myDataSource ). To avoid having to change your legacy code I think if you register the datasource with the name myDataSource (remove the jdbc/ ) you should be fine.
Posted Date:- 2021-09-16 08:45:23
1. Click the Servers node to expand it and expose the names of the servers currently being administered through the console.
2. Click the name of the server whose JNDI tree you want to view.
3. Scroll down to the bottom of the Configuration pane, and Click the "View JNDI Tree" link.
Posted Date:- 2021-09-16 08:43:56
Unlike a transaction on a local database, a distributed transaction involves altering data on multiple databases. During the commit phase, the initiating node asks all participating nodes to commit the transaction. ... If this outcome is not possible, then all nodes are asked to roll back.
Posted Date:- 2021-09-16 08:42:15
Propagation. REQUIRED is the default propagation mode of Transaction, so you don't need to explicitly set it.
Posted Date:- 2021-09-16 08:41:46
Examples of the transactional model include a face-to-face meeting, a telephone call, a Skype call, a chat session, interactive training, or a meeting in which all attendees participate by sharing ideas and comments.
Posted Date:- 2021-09-16 08:41:17
provider. url : The name of the environment property for specifying the location of the JBoss JNDI service provider the client will use. The NamingContextFactory class uses this information to know which JBossNS server to connect to. The value of the property should be a URL string.
Posted Date:- 2021-09-16 08:40:59
To View the JNDI Tree Structure
1. Expand Environment from the Domain tree structure on the left panel of the console.
2. Select Servers from the tree structure. ...
3. Click on exampleServer(admin). ...
4. Click on View JNDI Tree to open the JNDI Tree window. ...
5. Click on Examples, select Deployments, and click on EJB.
Posted Date:- 2021-09-16 08:38:35