Monday, February 29, 2016

Property Mediator - WSO2 ESB

Hi all,

Property mediator is another special mediator in WSO2 ESB. Property Mediator will not change message which will flow through ESB. But it has special qualities like retrieve properties set on message context. It is very useful as we check message properties with given commands.

Property mediator is conditionally content aware mediator. That means, it will not know message context without giving proper commands. We can give commands to see content and get action upon that.

Can retrieve properties using
      get-property(prop-name)
      
When defining this function, it has to be identify relevant scope. If a property has no defined scope, it defaults to the Synapse message context scope.

General syntax for property mediator.

<property name="string" [action=set|remove] [type="string"] (value="literal" | expression="xpath") [scope=default|transport|axis2|axis2-client] [pattern="regex" [group="integer"]]>
<xml-element/>
?
</property>

Ex:
<?xml version="1.0" encoding="UTF-8"?>
<property xmlns:ns="http://org.apache.synapse/xsd" expression="get-property('axis2','jms.message.delivery.count')" name="JMSXDeliveryCount" scope="default" type="INTEGER" />
              

Refere WSO2 Documentation if you keen to know parameters and to get more knowledge :)
Link: https://docs.wso2.com/display/ESB490/Property+Mediator

Note: Remember functionality of property mediator and different properties which can defined through its scope. It is a sure thing, that u will need "property mediator" if u are an ESB user :)

Waiting for value additions :)

Wednesday, February 24, 2016

Linux Commands - Manage Users

 Hi all,

In Linux, there will be several users. Main user who has administrative authorities is "root". Other than that, you can create users when you are required (I needed a user when installing Active MQ  :) ).

You can create users:
             useradd <username>
             Ex: useradd activemq
         
You can give a password for relevant user:
             sudo passwd <username>
             Ex: sudo passwd activemq

You can see details of available users and their passwords:
             sudo vim /etc/passwd

You can Change users:
             su <username>



Create cloud instances in WSO2 OpenStack

Hey,

I know u are a beginner who are just wondering to create a new instance in WSO2 OpenStack for the first time. Let's begin...

1. You have to login to OpenStack with your credentials : https://iaas.wso2.com/dashboard/auth/login/
(Note: In here use just the first part of your mail as the user name. Ex: hello@wso2.com then just use hello)

2. Make sure you are in the right category.



3. Go to "Access and Security" Panel

4. Go to "Key Pairs" tab and Click on "Create Key Pair". Give a name (Note: Key will always referring you in future instances and make sure to give a proper user name for your key. Ex: dilshani)
Then key will be downloaded.



5. Then lets create an instance. We can create instances from images. Go to "Images" panel.  You may find instance called "Centos-6.5".
So our example instance will create upon Cent OS. You may choose variety of choices like linux, windows etc. as images.

6.  Click on "Launch" and Give a name for instance. Flavor will indicate size of instance.Then click on "Launch"



7. Instance will be created and available in "Instances" Panel. You can go there and check for newly created instance. At there, you can see the IP address of your instance.

8. Lets login to remote instance in cloud.
Go to the place you downloaded your Key. (Ex: Downloads/). There you may find your key as .pem file (dilshani.pem)

From that location you can login to your instance. Type this in terminal:

ssh -i <keyfile> <cloud-username>@<IP of instance>

Ex: ssh -i dilshani.pem centos@192.168.23.55

Note: Cloud user name will be differ according to type of instance. (Ex: "ubuntu" for ubuntu OS, "centos" for Cent OS.

You are done with your first Instance in WSO2 OpenStack :)