英文:
WSO2 Identity Server 5.11 : Unable to publish HTTP events through proxy with the HTTPOutputEventAdapter
问题
I am trying to add an event publisher to send SMS OTP as described in the documentation below:
<https://is.docs.wso2.com/en/5.11.0/develop/enable-verification-for-updated-mobile-number/#step-01-add-an-event-publisher-to-send-sms>
The api Im trying to call through this event publisher is behind a proxy, so I have added the properties http.proxy.host, http.proxy.port to its configuration as follows:
<?xml version="1.0" encoding="UTF-8"?>
<eventPublisher name="HTTPOutputEventAdapter" processing="enable"
statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventpublisher">
<from streamName="id_gov_sms_notify_stream" version="1.0.0"/>
<mapping customMapping="disabled" type="json"/>
<to eventAdapterType="http">
<property name="http.client.method">httpGet</property>
<property name="http.url">https://api_sms/resources</property>
<!---------------------- PROXY --------------------------->
<property name="http.proxy.host">xx.xx.xx.xx</property>
<property name="http.proxy.port">8080</property>
<!---------------------- PROXY --------------------------->
</to>
</eventPublisher>
It seems that the proxy configuration is ignored, since I receive a timeout error when the event publisher is triggered:
ERROR {org.wso2.carbon.event.output.adapter.core.OutputEventAdapter} - Event dropped at Output Adapter 'HTTPOutputEventAdapter' for tenant id '-1234', Connection timed out (Connection timed out) java.net.ConnectException: Connection timed out (Connection timed out) at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:607) at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:288) at sun.security.ssl.SSLSocketImpl.<init>(SSLSocketImpl.java:193) at sun.security.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:153) at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:172) at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707) at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361) at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346) at org.wso2.carbon.event.output.adapter.http.HTTPEventAdapter$HTTPSender.run(HTTPEventAdapter.java:316) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)
Am I using the correct proxy configuration? otherwise, how can I add proxy configuration to an http out event publisher?
Thanks in advance.
英文:
I am trying to add an event publisher to send SMS OTP as described in the documentation below :
<https://is.docs.wso2.com/en/5.11.0/develop/enable-verification-for-updated-mobile-number/#step-01-add-an-event-publisher-to-send-sms>
The api Im trying to call through this event publisher is behind a proxy, so I have added the properties http.proxy.host , http.proxy.port to its configuration as follows :
<?xml version="1.0" encoding="UTF-8"?>
<eventPublisher name="HTTPOutputEventAdapter" processing="enable"
statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventpublisher">
<from streamName="id_gov_sms_notify_stream" version="1.0.0"/>
<mapping customMapping="disabled" type="json"/>
<to eventAdapterType="http">
<property name="http.client.method">httpGet</property>
<property name="http.url">https://api_sms/resources</property>
<!---------------------- PROXY --------------------------->
<property name="http.proxy.host">xx.xx.xx.xx</property>
<property name="http.proxy.port">8080</property>
<!---------------------- PROXY --------------------------->
</to>
</eventPublisher>
It seems that the proxy configuration is ignored, since I receive a timeout error when the event publisher is triggered :
ERROR {org.wso2.carbon.event.output.adapter.core.OutputEventAdapter} - Event dropped at Output Adapter 'HTTPOutputEventAdapter' for tenant id '-1234', Connection timed out (Connection timed out) java.net.ConnectException: Connection timed out (Connection timed out)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:607)
at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:288)
at sun.security.ssl.SSLSocketImpl.<init>(SSLSocketImpl.java:193)
at sun.security.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:153)
at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:172)
at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
at org.wso2.carbon.event.output.adapter.http.HTTPEventAdapter$HTTPSender.run(HTTPEventAdapter.java:316)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Am I using the correct proxy configuration ? otherwise , how can I add proxy configuration to an http out event publisher ?
Thanks in advance.
答案1
得分: 1
你应该面对的问题已在https://github.com/wso2/product-is/issues/9598中报告。根据我的分析,该问题存在于5.11.0版本中。
你将需要使用6.0版本或通过构建源代码来应用修复补丁。以下是创建自己补丁的指南:https://stackoverflow.com/questions/33521560/how-do-you-create-your-own-patches-for-wso2-identity-server。
附注:如果你是WSO2的订阅客户,你可以通过产品更新联系WSO2获取5.11.0版本的修复补丁。
英文:
You should be facing the issue reported in https://github.com/wso2/product-is/issues/9598. As per my analysis, the issue exists in 5.11.0.
You will have to use 6.0 or apply the fix as a patch by building the source code. Here is a guide for building your own patches; https://stackoverflow.com/questions/33521560/how-do-you-create-your-own-patches-for-wso2-identity-server.
PS: If you are a subscription customer of WSO2, you might contact WSO2 for a fix for 5.11.0 via product updates.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论