Created
August 6, 2022 20:42
-
-
Save muhdkhokhar/aa2f358a421908deca5846af98966863 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.demolistener; | |
import org.junit.jupiter.api.Test; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.boot.test.context.SpringBootTest; | |
import org.springframework.jdbc.core.JdbcTemplate; | |
import java.util.List; | |
import java.util.Map; | |
@SpringBootTest | |
class DemolistenerApplicationTests { | |
@Autowired | |
private JdbcTemplate jdbcTemplate; | |
@Test | |
void contextLoads() { | |
System.out.println(jdbcTemplate.queryForList("select * from auditlog")); | |
while(true){ | |
List<Map<String, Object>> maps = | |
jdbcTemplate.queryForList(" WAITFOR (\n" + | |
" RECEIVE TOP(1) message_type_name, \n" + | |
" CAST(message_body AS varchar(max)), \n" + | |
" conversation_handle\n" + | |
" FROM dbo.TestQueue )"); | |
System.out.println("========================"); | |
System.out.println(maps); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment