beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Baptiste Onofré (JIRA) <j...@apache.org>
Subject [jira] [Commented] (BEAM-870) JmsIO should be able to serialize the connection factory
Date Fri, 06 Jan 2017 16:56:58 GMT

    [ https://issues.apache.org/jira/browse/BEAM-870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15804988#comment-15804988
] 

Jean-Baptiste Onofré commented on BEAM-870:
-------------------------------------------

Basically, the idea is to "force" the serialization of the {{ConnectionFactory}} using a wrapper
like:

{code}
import java.io.Serializable;

public class SerializableWrapper<NotSerializableT> implements Serializable {
  private byte[] bytes;
  private volatile NotSerializableT actual;
  
  public SerializableWrapper(byte[] bytes) {
    this.bytes = bytes;
  }
  
  public NotSerializableT get() {
    if (actual == null) {
      synchronized(this) {
        if (actual == null) {
          actual = decode();
        }
      }
    }
    
    return actual;
  }
  
  private static <T> T decode() {
    //TODO: decode "bytes" into "actual" by coding the deserialization here, or use a coder.
  }
}
{code}

I started something like this on a branch.

> JmsIO should be able to serialize the connection factory
> --------------------------------------------------------
>
>                 Key: BEAM-870
>                 URL: https://issues.apache.org/jira/browse/BEAM-870
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-java-extensions
>            Reporter: Jean-Baptiste Onofré
>            Assignee: Jean-Baptiste Onofré
>
> Even if a JMS connection factory should be serializable (according to the specification),
some brokers may be flaky there.
> Instead of directly taking a connection factory, the JmsIO should create a connection
factory using a configuration (serializable).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message