Rename samples

This commit is contained in:
Ilayaperumal Gopinathan
2020-06-24 21:00:13 +05:30
parent cc3191ace4
commit 36648a23ba
26 changed files with 7 additions and 4 deletions

View File

@@ -0,0 +1,50 @@
/*
* Copyright 2019-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.stream.app.time.source.rabbit;
import java.util.Date;
import java.util.function.Supplier;
import org.apache.commons.lang3.time.FastDateFormat;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.fn.supplier.time.TimeSupplierProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
@SpringBootApplication
@Import({ org.springframework.cloud.fn.supplier.time.TimeSupplierConfiguration.class })
public class TimeSourceRabbitApplication {
@Bean
public Supplier<String> timeSupplier2(TimeSupplierProperties timeSupplierProperties) {
FastDateFormat fastDateFormat = FastDateFormat.getInstance(timeSupplierProperties.getDateFormat());
return () -> fastDateFormat.format(new Date());
}
@Bean
public Supplier<String> timeSupplier3(TimeSupplierProperties timeSupplierProperties) {
FastDateFormat fastDateFormat = FastDateFormat.getInstance(timeSupplierProperties.getDateFormat());
return () -> fastDateFormat.format(new Date());
}
public static void main(String[] args) {
SpringApplication.run(TimeSourceRabbitApplication.class, args);
}
}

View File

@@ -0,0 +1,2 @@
configuration-properties.classes=org.springframework.cloud.fn.supplier.time.TimeSupplierProperties,\
org.springframework.cloud.stream.config.DefaultPollerProperties

View File

@@ -0,0 +1,19 @@
spring.application.name=${vcap.application.name:time-source}
info.app.name=@project.artifactId@
info.app.description=@project.description@
info.app.version=@project.version@
management.endpoints.web.exposure.include=health,info,bindings
spring.cloud.stream.function.definition=timeSupplier;timeSupplier2;timeSupplier3
spring.cloud.stream.function.bindings.timeSupplier-out-0=output1
spring.cloud.stream.function.bindings.timeSupplier2-out-0=output2
spring.cloud.stream.function.bindings.timeSupplier3-out-0=output3
outputs=output1,output2
inputs=

View File

@@ -0,0 +1,32 @@
/*
* Copyright 2019-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.stream.app.time.source.rabbit;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class TimeSourceRabbitApplicationTests {
@Test
public void contextLoads() {
}
}