com.redismq.server.store.JdbcStoreStrategy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of redismq-server Show documentation
Show all versions of redismq-server Show documentation
redismq server and console
The newest version!
package com.redismq.server.store;
import com.redismq.common.config.GlobalConfigCache;
import com.redismq.common.constant.MessageStatus;
import com.redismq.common.pojo.GroupOffsetQeueryMessageDTO;
import com.redismq.common.pojo.Message;
import com.redismq.common.serializer.RedisMQStringMapper;
import com.redismq.server.pojo.HistoryMessageQueryDTO;
import com.redismq.server.pojo.HistoryMessageVO;
import com.redismq.server.pojo.PageResult;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.util.CollectionUtils;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Slf4j
public class JdbcStoreStrategy implements MessageStoreStrategy {
private static final String TABLE_NAME = " redismq_message ";
private static final String TABLE_FIELDS = "(id,body,queue,tag,`key`,virtual_queue_name,`offset`,header,status,executor_scope,execute_time) ";
private final JdbcTemplate jdbcTemplate;
public JdbcStoreStrategy(JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
}
@Override
public boolean saveMessages(List messages) {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy