Posts

Mule Configuration XML tags for RabbitMQ

Mule Configuration XML tags As we know, AMQP Connector was not auto included in the Studio/ Eclipse. I have created mule xml configuration manually for one of my project. Before started writing flow and global variables in mule configurations file, we need to write correct mule tag for rabbitmq so that Flow can work without breaking. Below is the tested mule tag. <mule xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:db="http://www.mulesoft.org/schema/mule/db" xmlns:jdbc-ee="http://www.mulesoft.org/schema/mule/ee/jdbc" xmlns:metadata="http://www.mulesoft.org/schema/mule/metadata" xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:amqp="http://www.mulesoft.org/schema/mule/amqp" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation...

Mule Flow: Reading messages from rabbitmq

In a project, Our Mule service was reading some messages from Rabbit MQ in the project. After that these messages was transformed from byte-array to object in json format. Step 2 was to convert these JSON object into the Java bean object. After converting it to Java object, passed these java object messages into our main java component for business logic. To achieving this, I followed below steps: Reading some messages from Rabbit MQ Transformed from byte-array to object in json format Convert these JSON object into the Java bean object Sent this workload into the Java class. For Step 1: Created some global variables in the MULE configuration xml file. <amqp:connector validateConnections="true" doc:name="AMQP Connector" name="AMQP_0_9_Connector" /> <amqp:endpoint exchangeName="main-exchange" queueName="<<Your Queue Name>>" exchangeDurable="true" name="AMQP_0_9_queue1...

java questions

    *      What is the use of bin and lib in JDK?- Bin contains all tools such as javac, appletviewer, awt tool, etc., whereas lib contains API and all packages.     *      What is casting?- Casting is used to convert the value of one type to another.     *      What is final, finalize() and finally?- final : final keyword can be used for class, method and variables. A final class cannot be subclassed and it prevents other programmers from subclassing a secure class to invoke insecure methods. A final method can’t be overridden. A final variable can’t change from its initialized value. finalize() : finalize() method is used just before an object is destroyed and can be called just prior to garbage collection. finally : finally, a key word used in exception handling, creates a block of code that will be executed after a try/catch block has completed and before the c...

Capture image from webcam java code, examples

import java.applet.Applet; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; import java.awt.Frame; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Panel; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.image.BufferedImage; import java.io.FileOutputStream; import java.net.MalformedURLException; import java.net.URL; import javax.media.Buffer; import javax.media.CaptureDeviceInfo; import javax.media.CaptureDeviceManager; import javax.media.Manager; import javax.media.MediaLocator; import javax.media.Player; import javax.media.control.FrameGrabbingControl; import javax.media.format.VideoFormat; import javax.media.util.BufferToImage; import javax.swing.JButton; import javax.swing.JComponent; import com.sun.image.codec.jpeg.JPEGCodec; import com.sun.image.codec.jpeg.JPEGE...

Map.Entry Interface

Map.Entry Interface -     Map.Entry Interface is used to hold the view of key-value pair from Map. Map interface has a method entrySet() which returns the Set object that holds the key value pair. You can iterate the key and value from getKey() and getValue(). You can also set value an element by the setValue() method. List of methods within the Map.Entry Interface -  boolean equals(Object o) -          This method is used to compares the specified object with this entry. If both are equal it return true otherwise return false.  K getKey() -     This method returns the key of map.  V getValue() -     This method returns the value of corresponding to this entry.  int hashCode() -     This method is used to return the hash code value for this map entry.  V setValue(V value) -     This method is used to set the values at  corr...

ListIterator Interface

ListIterator Interface -     ListIterator Interface is used for traverse list in both direction. You can find previous element by previous() method and next element by next() method. Within the both method ListIterator maintain the cursor position. ListIterator has previousIndex() for checking that List has previous index or not.      ListIterator Interface extends Iterator Interface. You can also set any new element in the list. List of methods within the ListIterator Interface - void add(E e) -     This method is used to add a given element into the list. boolean hasNext() -     This method is used to check the presence of element in the list when traversing the list in the forward direction. boolean hasPrevious() -     This method is used to check the presence of element in the list when traversing the list in the reverse direction. E next() -     this method is used to retu...

NavigableSet Interface

NavigableSet Interface -     NavigableSet Interface is very useful for searching strategics. NavigableSet Interface gives the functionality for closest search mechanism. NavigableSet may search less than, less than or equal, greater than or equal, and greater than through the lower, floor, ceiling, and higher methods. There is a example - import java.util.Iterator; import java.util.NavigableSet; import java.util.concurrent.ConcurrentSkipListSet; public class Test {     public static void main(String[] args) {             NavigableSet nSet = new ConcurrentSkipListSet();             nSet.add("A");             nSet.add("B");             nSet.add("C");             nSet.add("D");          ...

Recent Post

Recent Posts Widget