WSO2 EI and mqtt broker - wso2

WSO2 MB use to have an scalable mqtt broker
http://wso2.com/library/articles/2015/10/article-using-wso2-message-broker-as-a-scalable-mqtt-broker/
now replaced by WSO2 EI 6.1.1.
It is not clear to me when the broker must be provided or it is running inside the product.
While some doc seems to imply the broker is already there, some other examples ask for a mosquito or wso2 mb (now unavailable) separate instalation.
https://docs.wso2.com/display/EI611/Sample+906%3A+Inbound+Endpoint+MQTT+Protocol+Sample
A simple test with a mqtt client shows that, after normal EI installation and run, there is no mqtt broker running in the configured params, 127.0.0:1883.
<mqtt enabled="true">
<bindAddress>0.0.0.0</bindAddress>
<defaultConnection enabled="true" port="1883" />
Should I install a separate mqtt broker? or there is a way to run the already existent broker in the legacy MB?
Thanks!

You can run the broker with WSO2 EI using the broker.sh file located at {EI_HOME}/bin directory.
Another difference to note is once you start the broker you can see the following log
Successfully connected to MQTT server on port 1886
Within WSO2 EI product, broker runs with an offset of 3. Therefore you have to use the 1886 port to connect.
if you want you can change the offset using the offset element found at {EI_HOME}/wso2/broker/conf/carbon.xml file
Hope this helps.

Related

Can WSO2 API Manager send JMS messages to TIBCO EMS Server directly (No ESB in between)? How?

I'm trying to understand if and how is possible to send a JMS message to TIBCO EMS Server using WSO2 API Manager without using the WSO2 ESB in between.
The Pattern 1 of this article: http://wso2.com/library/articles/2015/10/article-how-to-enable-wso2-api-manager-to-work-as-a-jms-producer/ does something similar but for Apache ActiveMQ.
Is this possible? Any hint? Article?
Thanks in advance,
Gianfranco
EMS is a JMS provider like ActiveMQ.
The feature list mention : Maps between HTTP(s) and other protocols, such as JMS or writing to file systems.
You can ix the article you already have with JMS examples from the sample folder on a typical EMS installation.
I think the code will be mostly the same... but your are going to depend on jar provided inside the EMS installation.
You can follow the instructions here to configure the APIM[1] axis2.xml file.
As for placing the jars you need to do the following:
In the APIM_HOME/lib/endorsed folder delete the geronimo-jms_1.1_spec-1.1.0.wso2v1.jar
Add the jms-2.0.jar to the APIM_HOME/lib/endorsed folder
Add the tibjms.jar in the APIM_HOME/repository/components/libs folder.
[1] https://docs.wso2.com/display/Ei620/Configure+with+Tibco+EMS

Why do Data Services use the Servlet Ports as opposed to NIO/PT - WSO2

I've installed Dss 3.2.2 features onto Esb4.8.1.
When I create a proxy service the Service endpoints are as expected e.g
http://[ip]:8280/services/[proxy_service_name]
But when I create a dataservice , the service endpoints also show the same(NIO) port , contrary to the expected (mgmt) port :
http://[ip]:8280/services/[data_service_name]
But it should be
http://[ip]:9763/services/[data_service_name]
If I send a json post request to the 8280 for a dataservice , it does not receive any params :
"current_params": "{}"
Sending it to 9763 it reads my params:
"current_params": "{no=xxx, dump_size=10}"
Is there a config/way to fix this?
I believe you are using try-it tool shipped with WSO2 ESB by default. Let me explain what it the reason for this problem. WSO2 ESB exposes two HTTP ports (i.e NIO port which is 8280 and servlet port which is 9763) and when dataservice features are installed, data services are also exposed via both ports. By default ESB try-it uses NIO port(8280). The issue is ESB try-it tool does not handle invoking data service via NIO transport. It drops the parameters passed. That is why the current_params is empty. This is a known issue and will be fixed in a future release. As a workaround you can either use servlet port to invoke dataservice or any other soap client such as SoapUI.
Thanks

WSO2 ESB - start multiple instance of ESB with different port(receiving/listening port) from single installation of WSO2 ESB

Is it possible to start multiple instance of WSO2 ESB with different port configuration for each instance but from single installation of WSO2 ESB?
Like we do with tomcat (CATALINA_HOME and CATALINA_BASE).
AFAIK OOTB you can't start multiple instances of WSO2 ESB (or any Carbon based products) from a single installation as now.
But you can simply have multiple server installations (just unzip to wso2esb-x.x.x.zip to multiple folders). And run the server with -DportOffset option as follows,
$sh <CARBON_HOME>/bin/wso2server.sh -DportOffset=1
(Or use bat file if you are in windows)
Or if you want persist the port offset, you can open <CARBON_HOME>/repository/conf/carbon.xml file then search for tag <Offset> and set a port offset as follows,
<Offset>1</Offset>
And run the server with as usual (without the port offset option),
$sh <CARBON_HOME>/bin/wso2server.sh
HTH,
DarRay

How can I disable features WSO2 ESB 4.0.3?

We are in final few steps of WSO2 ESB / Data services implementation.
We are trying to pass the Information Security review of our WSO2 ESB implementation. We are using 4.0.3 EAB with 3.2.2 DSS feature.
Information security group has objected for following things in default WSO2 ESB
QPID / AMQP server listening to 5672 / 8672 ports. Can we disable the default message broker so that QPID will not start. If we disable, will it affect any other functionality? We are NOT using message brokers / any JMS related applications, mainly Data Services.
How to block JMX console being started? The JMX console starts at 11111 / 9999 be default.
We have already disabled Admin UI, however is there any way where I can turn the logging levels for individual loggers with out Admin UI and WITHOUT re- starting the ESB?
Can stop starting jmx server through CARBON_HOME/repository/conf/etc/jmx.xml by setting,
<StartRMIServer>false</StartRMIServer>
If the admin console was enabled, then you can configure the logging from the UI. Since you have disabled the admin console, then you can configure the loggers using the lgo4j.properties file in CARBON_HOME/repository/conf. But then you have to restart the server.
There is no other way to configure logging without restarting.
You can disable QPID server listening on 8672 TLS port with the following configuration change.
Go to /repository/conf/advanced/qpid-config.xml file and change the entry as below.
<broker>
<connector>
<!-- To enable SSL edit the keystorePath and keystorePassword
and set enabled to true.To disasble Non-SSL port set sslOnly to true -->
<ssl>
**<enabled>false</enabled>**
<sslOnly>false</sslOnly>
<keystorePath>repository/resources/security/wso2carbon.jks</keystorePath>
<keystorePassword>wso2carbon</keystorePassword>
</ssl>
After that QPID Broker will not be starting on TLS port. However regarding disabling the Qpid Server in 5672 TCP port, ESB 4.0.3 version comes with an embedded QPID broker which is tightly coupled with other ESB components. Therefore unfortunately it is not possible to detach the broker from the ESB with a configuration setting.This is changed after ESB 4.5.x versions where the embedded Qpid broker is no longer shipped with ESB, therefore if it is possible, you can upgrade the ESB version in order to meet this requirement.

wso2 new broker type

I have implemented a new Broker by extending the BrokerType and BrokerTypeFactory.
I wanted to deploy this new Broker to WSO2 CEP.
I created a broker.xml and placed it in repository/conf directory
<brokerTypes xmlns="wso2.org/carbon/broker">
<brokerType name="jmsQbroker" class="org.wso2.carbon.broker.core.internal.broker.jms.generic.GenericJMSQueueBr‌​okerType" /> </brokerTypes>
However this causes NullPointer exception ( in BrokerManagerAdminServer at line 149) when i browse to the Broker List page in the webconsole, and none of the brokers are shown.
Can you please help me in understanding how can i deploy my new broker without affecting the existing ones
There were some issues when deploying external brokers to earlier versions of CEP, This issue is fixed (from CEP 2.1.0).
you can find a guide on writing a custom broker at http://suhothayan.blogspot.com/2013/02/writing-custom-broker-for-wso2-cep.html
and you will be able to download CEP 2.1.0 RC from : https://svn.wso2.org/repos/wso2/people/suho/packs/cep/wso2cep-2.1.0-RC1.zip