Thursday, 9 February 2023

Tuesday, 7 February 2023

Cron job scheduling example

 https://reflectoring.io/spring-scheduler/

Grouping by example

 public static void main(String arg[]) {

    final AtomicInteger counter = new AtomicInteger(0);
List<Integer> questionsList = new ArrayList<>();
for(Integer i=0;i<100;i++) {

questionsList.add(i*2);
}
final Collection<List<Integer>> dividedByTenList = questionsList.stream()
.collect(Collectors.groupingBy(it -> counter.getAndIncrement() / 10))
.values();
dividedByTenList.forEach(batchlist -> {
System.out.println("hello pawan"+batchlist);
});
}

Wednesday, 1 February 2023

verify cognito token

 https://openid.net/developers/jwt/

jose4j

  • Open source implementation of JWT and the full JOSE suite. Developed by Brian Campbell.
  • License: Apache 2.0
  • Supports: JWT, JWS, JWE and JWK.
  • Target Environment: Java 7 or 8

Nimbus JOSE+JWT

Thursday, 6 October 2022

Thursday, 29 September 2022

Access S3 data without credentials

use Aws\S3\S3Client;

 $provider = CredentialProvider::defaultProvider();

$s3Client = new S3Client(array(
'version' => 'latest',
'region' => env('lambda_region'),
'credentials'=>$provider
));