hello i'm trying to insert the flow coming from https://gist.githubusercontent.com/Rajeun/9afed4a50d2158651d6b/raw/88c7c596f3cfda48b17b76a1e12c70adf355e94d/test.json into my database for this i'm using http request connector, Json to object, database connector and finally a logger with a message its ok. bellow you can find the configuration xml:
## <mule xmlns:db="http://www.mulesoft.org/schema/mule/db" xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.6.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd
http://www.mulesoft.org/schema/mule/db http://www.mulesoft.org/schema/mule/db/current/mule-db.xsd">
<http:request-config name="HTTP_Request_Configuration" host="https://gist.githubusercontent.com" port="80" doc:name="HTTP Request Configuration" protocol="HTTPS"/>
<db:mysql-config name="MySQL_Configuration" host="localhost" port="3306" user="root" database="mulesoft" doc:name="MySQL Configuration"/>
<flow name="testFlow">
<poll doc:name="Poll">
<http:request config-ref="HTTP_Request_Configuration" path="Rajeun/9afed4a50d2158651d6b/raw/88c7c596f3cfda48b17b76a1e12c70adf355e94d/test.json" method="GET" doc:name="HTTP"/>
</poll> <json:json-to-object-transformer returnClass="java.util.HashMap" doc:name="JSON to Object"/>
<response>
<logger message="its ok" level="INFO" doc:name="Logger"/>
</response>
<response>
<db:insert config-ref="MySQL_Configuration" doc:name="Database">
<db:parameterized-query><![CDATA[INSERT INTO push(token, tel, email) VALUES (2,3,#[payload['email']])]]></db:parameterized-query>
</db:insert>
</response>
</flow>
</mule> ##
the app is DEPLOYED and then there is a loop of errors.
## ERROR 2015-03-23 11:17:28,672 [pool-13-thread-1] org.mule.exception.DefaultMessagingExceptionStrategy:
********************************************************************************
Message : Error sending HTTP request. Message payload is of type: String
Code : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. null (java.nio.channels.UnresolvedAddressException)
sun.nio.ch.Net:-1 (null)
2. java.nio.channels.UnresolvedAddressException (java.util.concurrent.ExecutionException)
org.glassfish.grizzly.impl.SafeFutureImpl$Sync:363 (null)
3. java.util.concurrent.ExecutionException: java.nio.channels.UnresolvedAddressException (java.io.IOException)
org.mule.module.http.internal.request.grizzly.GrizzlyHttpClient:274 (null)
4. Error sending HTTP request. Message payload is of type: String (org.mule.api.MessagingException)
org.mule.module.http.internal.request.DefaultHttpRequester:190 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.nio.channels.UnresolvedAddressException
at sun.nio.ch.Net.checkAddress(Unknown Source)
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
at org.glassfish.grizzly.nio.transport.TCPNIOConnectorHandler.connectAsync(TCPNIOConnectorHandler.java:133)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)##
I am very new to mule studio and I am using Mule Studio CE, actually i don't know what is the probleme with my example please any step by step help (like what component i missed or something like this), thank you in advance
The port for HTTPS is 443
not 80
. Also the host
attribute is just the host, no protocol should be put there.
So replace this:
host="https://gist.githubusercontent.com" port="80"
with that:
host="gist.githubusercontent.com" port="443" protocol="HTTPS"
Reference material: http://www.mulesoft.org/documentation/display/current/HTTP+Request+Connector