-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(sns,sqs): remove custom deserialization of AWS msg attributes
Due to multiple instances of GSON, in a bundled version that contains all the connectors, there is a conflict between the GSON instances. As such, some deserializers seem not to be registered / working as expected. This commit solves an issue with the SNS Connector.
- Loading branch information
Showing
20 changed files
with
291 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
connectors/sns/src/main/java/io/camunda/connector/model/SnsMessageAttribute.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH | ||
* under one or more contributor license agreements. Licensed under a proprietary license. | ||
* See the License.txt file for more information. You may not use this file | ||
* except in compliance with the proprietary license. | ||
*/ | ||
package io.camunda.connector.model; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
import java.util.Objects; | ||
import javax.validation.constraints.NotBlank; | ||
|
||
public class SnsMessageAttribute { | ||
@SerializedName(value = "DataType", alternate = "dataType") | ||
@NotBlank | ||
private String dataType; | ||
|
||
@SerializedName(value = "StringValue", alternate = "stringValue") | ||
@NotBlank | ||
private String stringValue; | ||
|
||
public String getDataType() { | ||
return dataType; | ||
} | ||
|
||
public void setDataType(String dataType) { | ||
this.dataType = dataType; | ||
} | ||
|
||
public String getStringValue() { | ||
return stringValue; | ||
} | ||
|
||
public void setStringValue(String stringValue) { | ||
this.stringValue = stringValue; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
|
||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
|
||
SnsMessageAttribute that = (SnsMessageAttribute) o; | ||
return dataType.equals(that.dataType) && stringValue.equals(that.stringValue); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(dataType, stringValue); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "SNSMessageAttribute{" | ||
+ "dataType='" | ||
+ dataType | ||
+ '\'' | ||
+ ", stringValue='" | ||
+ stringValue | ||
+ '\'' | ||
+ '}'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 0 additions & 54 deletions
54
connectors/sns/src/main/java/io/camunda/connector/suppliers/GsonComponentSupplier.java
This file was deleted.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
connectors/sns/src/main/java/io/camunda/connector/suppliers/SnsGsonComponentSupplier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH | ||
* under one or more contributor license agreements. Licensed under a proprietary license. | ||
* See the License.txt file for more information. You may not use this file | ||
* except in compliance with the proprietary license. | ||
*/ | ||
package io.camunda.connector.suppliers; | ||
|
||
import com.google.gson.Gson; | ||
import com.google.gson.GsonBuilder; | ||
|
||
public final class SnsGsonComponentSupplier { | ||
|
||
private static final Gson GSON = new GsonBuilder().create(); | ||
|
||
private SnsGsonComponentSupplier() {} | ||
|
||
public static Gson gsonInstance() { | ||
return GSON; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.