Comments (5)
+1 for this feature. Or at least enable overriding DataConverter
using @Activity
instead of only possible to define the DataConverter
in @Activities
.
from aws-sdk-java.
Hi, I have asked the Simple Workflow team to look at your question.
from aws-sdk-java.
Flow Framework calls fromData passing it the type information of the top level type that it is trying to deserialize, which in the case of activity inputs is Object[]. The serialization format is expected to contain the necessary information to properly handle the round trip serialization/deserialization of types including generic types and collections. Even if Flow Framework passed in an array of types to fromData, your DataConverter needs to be able to handle the object graph within it, for example you may have a field of type Object[].
Which serialization format are you using in your custom DataConverter? The JsonDataConverter included in Flow Framework produces JSON with type information (it uses Jackson JSON Processor under the covers).
from aws-sdk-java.
Handling the object graph once you know the top-level type is not a problem. yes, it's true one could define their activity as something like myActivity(Object[] arg1, Object[] arg2, etc.) but that's up to individual users if they want to structure their code that way. At least by passing in an array of types to fromData, I have the choice to preserve type information or not.
It's really limiting and requires pretty tight coupling in a distributed system like this for the producer of the output to need to know how the consumer will deserialize the data.
E.g. If I have workers written in Ruby, and a decider in Java, the Ruby workers are are expected to include Java type information for deserialization in their JSON output?
The Flow Framework has the actual type information for the activity method arguments available to it. It would be really helpful to pass it along.
from aws-sdk-java.
You are correct in pointing out that Flow Framework has additional type information about the parameters that it can pass to the DataConverter. I was trying to clarify that this would not completely solve the problem in the general case and your serialization format would need some type hints for things like collections, derived types etc. Type hints don't have to be language specific, for example in XML you could use xsi:type. I think to properly implement a cross-language use case you would also need some mechanism to express types in a language neutral way that you can then map to types in each of the languages -- protocol buffers and XSD come to mind.
That said, we will consider exposing the declared parameter types to the fromData method to make it easier to implement custom DataConverters.
from aws-sdk-java.
Related Issues (20)
- Credential Provider Chain Not Working HOT 4
- Use of deprecated ion-java HOT 19
- GetBlobStoreContext failing after updating the aws-sdk HOT 3
- Error while publishing the image using the pre-signed url generated. (SignatureDoesNotMatch) HOT 4
- Single Table Design Pattern - Fetch only selected entities by giving begins_with or starts_with sort key HOT 1
- Update dependency: httpcomponents HOT 2
- Update jackson-databind dependency HOT 2
- ClusterNotFoundException is thrown when cluster exists in the account/region HOT 3
- [Auth] the pod falling back to instance role instead of IRSA HOT 2
- AWS SDK Metrics not reporting HttpClientPoolAvailableCount or HttpClientPoolPendingCount HOT 2
- ListNextBatchOfObjectsRequest does not retain RequestCredentialsProvider HOT 1
- Cognito User Pool Self-Service Sign-Up not working HOT 1
- Getting Unable to execute HTTP request: connect timed out: software.amazon.awssdk.core.exception.SdkClientException software.amazon.awssdk.core.exception.SdkClientException: Unable to execute HTTP request: connect timed out HOT 1
- AWS Java SDK not supporting environment variable override HOT 2
- (short issue description) HOT 1
- TransferManager.upload doesn't retain `bucketKeyEnabled` setting if using multipart upload HOT 1
- Getting "Credential should be scoped to a valid region." error when try to create an IAM client by using us-west-2 as a region HOT 3
- Enabling Metrics for the AWS SDK for Java failed without no error msg HOT 4
- Intermittent stall of S3 PUT request for about 17 minutes HOT 3
- finalizeMultipartUpload is throwing 404 error HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-sdk-java.