Skip to content

Commit

Permalink
Ability to replace interop strategies for both Kafka and MQTT transpo…
Browse files Browse the repository at this point in the history
…rts. Closes GH-596. Closes GH-597
  • Loading branch information
jeremydmiller committed Oct 20, 2023
1 parent 5d9cf21 commit ee979dc
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,15 @@ public KafkaListenerConfiguration(Func<KafkaTopic> source) : base(source)
{
}


/// <summary>
/// Use a custom interoperability strategy to map Wolverine messages to an upstream
/// system's protocol
/// </summary>
/// <param name="mapper"></param>
/// <returns></returns>
public KafkaListenerConfiguration UseInterop(IKafkaEnvelopeMapper mapper)
{
add(e => e.Mapper = mapper);
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,15 @@ internal KafkaSubscriberConfiguration(KafkaTopic endpoint) : base(endpoint)
{
}

/// <summary>
/// Use a custom interoperability strategy to map Wolverine messages to an upstream
/// system's protocol
/// </summary>
/// <param name="mapper"></param>
/// <returns></returns>
public KafkaSubscriberConfiguration UseInterop(IKafkaEnvelopeMapper mapper)
{
add(e => e.Mapper = mapper);
return this;
}
}
12 changes: 12 additions & 0 deletions src/Transports/MQTT/Wolverine.MQTT/MqttListenerConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,16 @@ public MqttListenerConfiguration QualityOfService(MqttQualityOfServiceLevel serv
add(e => e.QualityOfServiceLevel = serviceLevel);
return this;
}

/// <summary>
/// Use a custom interoperability strategy to map Wolverine messages to an upstream
/// system's protocol
/// </summary>
/// <param name="mapper"></param>
/// <returns></returns>
public MqttListenerConfiguration UseInterop(IMqttEnvelopeMapper mapper)
{
add(e => e.EnvelopeMapper = mapper);
return this;
}
}
12 changes: 12 additions & 0 deletions src/Transports/MQTT/Wolverine.MQTT/MqttSubscriberConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,16 @@ public MqttSubscriberConfiguration QualityOfService(MqttQualityOfServiceLevel se
add(e => e.QualityOfServiceLevel = serviceLevel);
return this;
}

/// <summary>
/// Use a custom interoperability strategy to map Wolverine messages to an upstream
/// system's protocol
/// </summary>
/// <param name="mapper"></param>
/// <returns></returns>
public MqttSubscriberConfiguration UseInterop(IMqttEnvelopeMapper mapper)
{
add(e => e.EnvelopeMapper = mapper);
return this;
}
}

0 comments on commit ee979dc

Please sign in to comment.