title: Redis exception with transactions with Jedis client
body: <p>In order to avoid duplicates in my redis channel I'm checking if the message is already there by keeping an index in Redis set. Following is my implementation. However, it is giving an exception. </p>
  
  <pre><code>redis.clients.jedis.exceptions.JedisDataException: Please close pipeline or multi block before calling this method.
      at redis.clients.jedis.Response.get(Response.java:23)
  </code></pre>
  
  <p>Here is the implementation. </p>
  
  <pre><code>          Jedis jedis = pool.getResource();
  
            String id = message.getId();
            Transaction transaction = jedis.multi();
            redis.clients.jedis.Response&lt;java.lang.Boolean&gt; response = transaction.sismember(ID_SET_REDIS_KEY, id);
            if (response != null &amp;&amp; !response.get().booleanValue()) {
                  //add it to the 
                  transaction.sadd(ID_SET_REDIS_KEY, id);
                  transaction.publish(redisChannelName, message);
              }
              transaction.exec();
              pool.returnResource(jedis);
  </code></pre>
  
  <p>I need to do the get inside the transaction because there are multiple publishers who may publish the exact same message. </p>