无法使用 Apache Maven 3.8.4 构建 AWS SQS Connector (V1.0.7)

Unable to build AWS SQS Connector (V1.0.7) by using Apache Maven 3.8.4

我想在现有的 AWS SQS 连接器 (V1.0.7) 中编辑 SendMessage 操作代码,并想构建这个可编辑的连接器并在 WSO2 EI 6.4.0 中使用它。

编辑现有代码的原因: 无法 post 经常将传入的有效负载放入 AWS SQS 队列。更多参考 click here

我遵循的步骤:

只需将终结点超时错误处理添加到现有的 http 调用。

<http method="post" uri-template="{uri.var.apiUrl}{+uri.var.httpRequestUri}">
<timeout>
<duration>60000</duration>
</timeout>
<suspendOnFailure>
<errorCodes>-1</errorCodes>
<initialDuration>0</initialDuration>
<progressionFactor>1.0</progressionFactor>
<maximumDuration>0</maximumDuration>
</suspendOnFailure>
<markForSuspension>
<retriesBeforeSuspension>0</retriesBeforeSuspension>
</markForSuspension>
</http>

错误日志:

[2022-01-21 12:25:05,159] ERROR {org.apache.synapse.deployers.LibraryArtifactDeployer} - Deployment of synapse artifact failed for synapse libray at : C:\Development_Avecto\WSo2EIServers\wso2ei-6.6.0\wso2ei-6.6.0\repository\deployment\server\synapse-libs\amazonsqs-connector-1.0.7.zip : Error while extracting Synapse Library : amazonsqs-connector-1.0.7.zip org.apache.synapse.SynapseException: Error while extracting Synapse Library : amazonsqs-connector-1.0.7.zip
    at org.apache.synapse.libraries.util.LibDeployerUtils.extractSynapseLib(LibDeployerUtils.java:426)
    at org.apache.synapse.libraries.util.LibDeployerUtils.createSynapseLibrary(LibDeployerUtils.java:65)
    at org.apache.synapse.deployers.LibraryArtifactDeployer.deploy(LibraryArtifactDeployer.java:60)
    at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136)
    at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:807)
    at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144)
    at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:377)
    at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:254)
    at org.apache.axis2.deployment.RepositoryListener.startListener(RepositoryListener.java:371)
    at org.apache.axis2.deployment.scheduler.SchedulerTask.checkRepository(SchedulerTask.java:59)
    at org.apache.axis2.deployment.scheduler.SchedulerTask.run(SchedulerTask.java:67)
    at org.wso2.carbon.core.deployment.CarbonDeploymentSchedulerTask.runAxisDeployment(CarbonDeploymentSchedulerTask.java:93)
    at org.wso2.carbon.core.deployment.CarbonDeploymentSchedulerTask.run(CarbonDeploymentSchedulerTask.java:138)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access1(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
    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)
    Caused by: java.io.FileNotFoundException: C:\Development_Avecto\WSo2EIServers\wso2ei-6.6.0\wso2ei-6.6.0\bin\..\wso2\tmp\libs42748105152amazonsqs-connector-1.0.7.zip\amazonsqs-connector-1.0.7\amazonSQS-config\component.xml (The system cannot find the path specified)
    at java.io.FileOutputStream.open0(Native Method)
    at java.io.FileOutputStream.open(FileOutputStream.java:270)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:101)
    at org.apache.synapse.libraries.util.LibDeployerUtils.extract(LibDeployerUtils.java:469)
    at org.apache.synapse.libraries.util.LibDeployerUtils.extractSynapseLib(LibDeployerUtils.java:424)

我知道这不是正确的做法。

任何 WSO2 专家都可以指导我编辑现有连接器代码的方法,将其构建为连接器以便使用它们吗?

已解决上述连接器构建问题,现在我可以在 WSO2 EI 服务器中使用自定义构建的 AWS SQS 连接器 (V1.07)。

步骤:

  • 打开sendMessage.xml操作文件目录esb-connector-amazonsqs-org.wso2.carbon.connector.amazonsqs-1.0.7\src\main\resources\amazonSQS-message
  • 修改部分如下。
  • 再次转到 esb-connector-amazonsqs-org.wso2.carbon.connector.amazonsqs-1.0.7 所在的目录 pom.xml
  • 运行 mvn clean install 在上面的目录中。
  • 构建成功后,我们可以在esb-connector-amazonsqs-org.wso2.carbon.connector.amazonsqs-1.0.7\target
  • 目录下得到amazonsqs-connector-1.0.7.zip个文件