@Bean
    @ConditionalOnMissingBean(TaskQueue.class)
    @Qualifier("taskQueue")
    @ConditionalOnProperty("shenyu.shared-pool.max-work-queue-memory")
    public TaskQueue<Runnable> memoryLimitedTaskQueue(final ShenyuConfig shenyuConfig) {
        final Instrumentation instrumentation = ByteBuddyAgent.install();
        final ShenyuConfig.SharedPool sharedPool = shenyuConfig.getSharedPool();
        final Long maxWorkQueueMemory = sharedPool.getMaxWorkQueueMemory();
        if (maxWorkQueueMemory <= 0) {
            throw new ShenyuException("${shenyu.sharedPool.maxWorkQueueMemory} must bigger than 0 !");
        }
        return new MemoryLimitedTaskQueue<>(maxWorkQueueMemory, instrumentation);
    }
@Test
    public void testMemoryLimitedTaskQueue() {
        ShenyuConfig shenyuConfig = mock(ShenyuConfig.class);
        ShenyuConfig.SharedPool sharedPool = mock(ShenyuConfig.SharedPool.class);
        when(shenyuConfig.getSharedPool()).thenReturn(sharedPool);
        when(sharedPool.getMaxWorkQueueMemory()).thenReturn(1024L);
        assertTrue(shenyuThreadPoolConfiguration.memoryLimitedTaskQueue(shenyuConfig) instanceof MemoryLimitedTaskQueue);
        when(sharedPool.getMaxWorkQueueMemory()).thenReturn(0L);
        assertThrows(ShenyuException.class, () -> shenyuThreadPoolConfiguration.memoryLimitedTaskQueue(shenyuConfig));

    }