"WHERE id = :id")
     fun setStateForMessageId(id: String, state: String, currentDate: Date): Int
 
+    @Modifying
+    @Transactional
+    @Query("UPDATE MessagePrioritization SET priority = :priority, updatedDate = :currentDate " +
+            "WHERE id = :id")
+    fun setPriorityForMessageId(id: String, priority: String, currentDate: Date): Int
+
     @Modifying
     @Transactional
     @Query("UPDATE MessagePrioritization SET state = :state, updatedDate = :currentDate " +
             "WHERE id IN :ids")
     fun setStateForMessageIds(ids: List<String>, state: String, currentDate: Date): Int
 
+    @Modifying
+    @Transactional
+    @Query("UPDATE MessagePrioritization SET priority = :priority, updatedDate = :currentDate " +
+            "WHERE id IN :ids")
+    fun setPriorityForMessageIds(ids: List<String>, priority: String, currentDate: Date): Int
+
     @Modifying
     @Transactional
     @Query("UPDATE MessagePrioritization SET state = :state, error = :error, updatedDate = :currentDate " +
 
     @Column(name = "message_state", length = 20, nullable = false)
     lateinit var state: String
 
+    @Column(name = "priority", nullable = false)
+    var priority: Int = 5
+
     @Lob
     @Column(name = "message", nullable = false)
     var message: String? = null
 
 
     suspend fun setMessageState(id: String, state: String)
 
+    suspend fun setMessagesPriority(ids: List<String>, priority: String)
+
     suspend fun setMessagesState(ids: List<String>, state: String)
 
     suspend fun setMessageStateANdError(id: String, state: String, error: String)
         prioritizationMessageRepository.setStateForMessageId(id, state, Date())
     }
 
+    @Transactional
+    override suspend fun setMessagesPriority(ids: List<String>, priority: String) {
+        prioritizationMessageRepository.setPriorityForMessageIds(ids, priority, Date())
+    }
+
     @Transactional
     override suspend fun setMessagesState(ids: List<String>, state: String) {
         prioritizationMessageRepository.setStateForMessageIds(ids, state, Date())
 
             group = groupName
             type = messageType
             state = messageState
+            priority = 5
             correlationId = messageCorrelationId
             message = "I am the Message"
             createdDate = Date()