Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Key Value producer method "send(Map<String, String> ..)" #67

Merged
merged 1 commit into from
Jul 13, 2015

Conversation

jgsofi
Copy link
Contributor

@jgsofi jgsofi commented Jul 13, 2015

Bug

The key-value pair Consumer option does not have a corresponding Producer method.

Story

Developer: "I want to create a producer that can send to SomeConsumer, but I don't have the documentation, lets look at the source."

@Message
Map<String, String> msg;

@OnValidate
public bool validate() {
    returm msg.hasKey("a") && msg.hasKey("b");
}

Developer: "Oh, I get it, I just need to send a Map like this."

Map<String, String> msg = new HashMap<>();
msg.set("a", "data1");
msg.set("b", "data2");
forkliftProducer.send(msg);

Forklift: validation failed

Developer: ???

Explanation

The map was serialized as JSON in the Producer, but deserialized as key-value pairs on the Consumer, even though they share the same type.)

Fix

Add an additional send(...) method so that sending a Map<String, String> serializes to key-value pairs instead of JSON.

Testing/Deployment

This changes both forklift connector plugin API and the forklift plugins that depend on it. It requires that you locally deploy a new forklift core before you build or test the ActiveMQProducer plugin.

dcshock added a commit that referenced this pull request Jul 13, 2015
Adding Key Value producer method "send(Map<String, String> ..)"
@dcshock dcshock merged commit 46b6bb2 into dcshock:develop Jul 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants