Monthly Archives: April 2014

Message Queue – Part 3 (Jms Domains)

JMS identifies two styles of messaging (or domains as they’re referred to in the spec)— point-to-point and publish/subscribe. Most Message Oriented MiddleWares (MOM)s already supported both of these messaging styles.

 

Point to Point Domain

  1. The point-to-point (PTP) messaging domain uses destinations known as queues.
  2. Messages are sent and received either synchronously or asynchronously using queues.
  3. Each message received on the queue is delivered once and only once to a single consumer.
  4. Consumers receive messages from the queue either synchronously using the MessageConsumer.receive() method or asynchronously by registering a
  5. MessageListener implementation using the MessageConsumer.setMessage-Listener() method.
  6. The queue stores all messages until they’re delivered or until they expire.
  7. Multiple consumers can be registered on a single queue.
  8. Message sent from a single producer and is delivered to a single consumer, not all consumers.
  9. JMS provider guarantees the delivery of a message once and only once to the next available registered consumer.
JMS Domain using Queue

JMS Domain using Queue

 

 

Publish / Subscribe Domain

  1. The publish/subscribe (pub/sub) messaging domain uses destinations known as topics
  2. Publishers send messages to the topic and subscribers register to receive messages from the topic
  3. Any messages sent to the topic are automatically delivered to all subscribers ( This messaging domain is similar to subscribing to a mailing list where all subscribers will receive all messages sent to the mailing list in a one-to-many paradigm)
  4. Topics don’t hold messages unless explicitly instructed to do so, This can be achieved via the use of a durable subscription.

Using a durable subscription, when a subscriber disconnects from the JMS provider, it’s the responsibility of the JMS provider to store messages for the subscriber. Upon reconnecting, the durable subscriber will receive all unexpired messages from the JMS provider. Durable subscriptions allow for subscriber disconnection without missing any messages.

Messaging Topics

JMS Domain using Topics

 

Distinguishing message durability from message persistence

Sounds Simple But Yet difficult to understand, there are some semantic differences between them and each has its specific purpose.

Durability

Message durability can only be achieved with the pub/sub domain. When clients connect to a topic, they can do so using a durable or a non-durable subscription.

Durable Subscription

      1. It is infinite
      2. It is registered with topic subscription to tell the JMS provider to preserve the subscription state even the subscriber disconnects
      3. It will preserve the message until subscriber connects again or until subscriber explicitly unsubscribes from the topic.

Non Durable Subscription

      1. It is finite
      2. It is registered with topic subscription to tell the JMS provider to not to preserve the subscription state even the subscriber disconnects.
      3. If a subscriber disconnects, the JMS Provider  won’t hold any messages during the disconnected time-span/period.

Persistance

Message persistence is independent of the message domain. It is a quality of service that indicates the JMS application’s ability to handle missing messages in the event of a JMS provider failure. This Quality of Service  is specified on the message producer’s setDeliveryMode method using one of the JMSDeliveryMode class’s PERSISTENT or NON-PERSISTENT properties
as an argument

 

Message Queue – Part 2 (JMS)

What is JMS (  Java Messaging Service )

The Java Message Service (JMS) moved beyond vender-centric MOM APIs to provide an API for enterprise messaging. JMS aims to provide a standardized API
to send and receive messages using the Java programming language in a vendor-neutral manner.

JMS is not itself a MOM. It is an API that abstracts the interaction between messaging clients and MOMs in the same manner that JDBC abstracts
communication with relational databases.

JMS Clients and Providers

  • JMS client —An application is written using 100% pure Java to send and receive messages.
  • Non-JMS client —An application is written using the JMS provider’s native client API to send and receive messages instead of JMS.
  • JMS producer —A client application that creates and sends JMS messages.
  • JMS consumer—A client application that receives and processes JMS messages.
  • JMS provider—The implementation of the JMS interfaces, which is ideally written in 100% pure Java.
  • JMS message—The most fundamental concept of JMS; sent and received by JMS clients.
  • JMS domains—The two styles of messaging that include point-to-point and publish/subscribe.
  • Administered objects —Preconfigured JMS objects that contain provider-specific configuration data for use by clients. These objects are typically accessible by clients via JNDI.
  • Connection factory—Clients use a connection factory to create connections to the JMS provider.
  • Destination—An object to which messages are addressed and sent and from which messages are received.

Message Queue – Part 1 (Message Broker)

Message Queue Flow

Message Queue Flow

Understanding Message Broker

Message broker is an intermediary program which translates the language of a system from one Globally acceptable languages to another by way of a telecommunications medium.

In Simple , It mediates communication amongst applications.

The purpose of a broker is to take incoming messages from applications and perform some action on them.

Route messages to one or more of many destinations

  • Transform messages to an alternative representation
  • Interact with an external repository to augment a message or store it
  • Invoke Web Service to retrieve data
  • Respond to events or errors
  • Provide content and topic-based message routing using the publish-subscribe pattern. etc

What’s message-oriented middleware (MOM)

  1. A category of software for communication in an asynchronous, loosely-coupled, reliable, scalable, and secure manner among distributed applications or systems
  2. It acts as a message mediator between message senders and message receivers.
  3. Applications send and receive messages via the MOM using what are known as destinations.
  4. Senders know nothing about receivers and receivers know nothing about senders. This is known as asynchronous messaging.
  5. A MOM to provide an API for sending and receiving messages and otherwise interacting with the MOM.

 

 

 

 

 

 

 

Maven – Super POM.xml

Maven always executes against an effective POM, a combination of settings from this project’s pom.xml, all parent POMs, a super-POM defined within Maven, user-defined settings, and active profiles.

All projects ultimately extend the super-POM, which defines a set of sensible default configuration settings. While your project might have a relatively minimal pom.xml, the contents of your project’s POM are interpolated with the contents of all parent POMs, user settings, and any active profiles. To see this “effective” POM, run the following command in the simple project’s base directory.


$ mvn help:effective-pom

When you run this, you should see a much larger POM which exposes the default settings of Maven. This goal can come in handy if you are trying to debug a build and want to see how all of the current project’s ancestor POMs are contributing to the effective POM.

 

References :

 

1- http://maven.apache.org/ref/3.0.4/maven-model-builder/super-pom.html

 

(SOLVED) XAMPP – Access Forbidden 403 Error – Windows

Recently i was working on my new android application, got to make it connected to mysql database, so i started XAMPP along MYSQL , wrote some php code to test the connection … but was stucked with error!

Access forbidden! New XAMPP security concept. Error 403

 

Access Forbidden 403 ( New XAMPP security concept )

Access Forbidden 403 ( New XAMPP security concept )

Yuck! during development and seeing unforced/unwanted errors… after all a few mins R&D and research , i got a solution at two different websites … but individually they were bit incomplete and on combining both solutions , i got the issue resolved 🙂

 

Open httpd-vhosts.conf file and in the bottom of the file change it

<VirtualHost *:80>
DocumentRoot “E:/xampp/htdocs/”
ServerName localhost
<Directory E:/xampp/htdocs/>.
Require all granted
</Directory>
</VirtualHost>

 

Here E:/xampp is my project workspace, you can change it as per your settings and Second Change is

Now Open httpd-xampp.conf file and in the bottom of the file change it

#
# New XAMPP security concept
#
<LocationMatch “^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))”>
Order deny,allow
Allow from all
Allow from ::1 127.0.0.0/8
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>

NOTE : Make sure u  backup files ( httpd-xampp.conf ) and ( httpd-vhosts.conf ) , Both Files are located in Drive:\xampp\apache\conf\extra

References :

1- https://community.apachefriends.org/f/viewtopic.php?f=17&t=37286

2- http://tutorialsea.com/kb/linux-tutorial/access-forbidden-new-xampp-security-concept-error-403/

3- https://bbs.archlinux.org/viewtopic.php?id=148165

i found link #02 and #03 pretty useful.

Project IAD 2015 –

Complete Details are available ..

Project Breadcrum , structure and tasks are structured down.

iadproject