Mule: Connect to HTTPS site and pull files

安稳与你 提交于 2020-01-06 14:46:35

问题


I am trying to set up Quartz to initiate processing which will connect to a HTTPS endpoint in order to pull files from a directory. The HTTPS endpoint will try to redirect for authentication so I am trying to set up for this. I have a self signed keystore for the HTTPS connector.

This is currently deploying but I am unsure if this is the correct method and if so how to then pull the files from the endpoint.

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:json="http://www.mulesoft.org/schema/mule/json"
    xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
    xmlns:https="http://www.mulesoft.org/schema/mule/https" xmlns:quartz="http://www.mulesoft.org/schema/mule/quartz" xmlns:http="http://www.mulesoft.org/schema/mule/http"
    xmlns:file="http://www.mulesoft.org/schema/mule/file"
    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.5.2"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.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/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
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/https http://www.mulesoft.org/schema/mule/https/current/mule-https.xsd
http://www.mulesoft.org/schema/mule/quartz http://www.mulesoft.org/schema/mule/quartz/current/mule-quartz.xsd">
    <quartz:connector name="myConnector" validateConnections="true" doc:name="Quartz">
        <receiver-threading-profile maxThreadsActive="1"/>
    </quartz:connector>
    <https:connector name="HTTP_HTTPS" cookieSpec="netscape" validateConnections="true" sendBufferSize="0" receiveBufferSize="0" receiveBacklog="0" clientSoTimeout="10000" serverSoTimeout="10000" socketSoLinger="0" doc:name="HTTP-HTTPS">
        <https:tls-key-store path="keystore.jks" keyPassword="password" storePassword="password"/>
    </https:connector>
    <https:connector name="HTTP_HTTPS1" cookieSpec="netscape" validateConnections="true" sendBufferSize="0" receiveBufferSize="0" receiveBacklog="0" clientSoTimeout="10000" serverSoTimeout="10000" socketSoLinger="0" doc:name="HTTP-HTTPS">
        <https:tls-key-store path="kaystore.jks" keyPassword="password" storePassword="password"/>
    </https:connector>
    <https:endpoint exchange-pattern="request-response" host="SITE" port="443" path="PATH" method="POST" connector-ref="HTTP_HTTPS1" name="HTTP" doc:name="HTTP"/>
    <flow name="Flow1" doc:name="Flow1">
        <quartz:inbound-endpoint jobName="runJob" repeatInterval="60000" startDelay="100" responseTimeout="10000" doc:name="Quartz" connector-ref="myConnector">
            <quartz:event-generator-job/>
        </quartz:inbound-endpoint>
        <logger message="Starting + #[message.payload]" level="INFO" doc:name="Logger"/>
        <https:outbound-endpoint exchange-pattern="request-response"   path="PATH" connector-ref="HTTP_HTTPS" method="GET" doc:name="HTTP" password="Password" user="USER" followRedirects="true" ref="HTTP"/>
        <logger message="Ending + #[message.payload]" level="INFO" doc:name="Logger"/>
    </flow>
</mule>

来源:https://stackoverflow.com/questions/27277561/mule-connect-to-https-site-and-pull-files

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!