rebus-org / Rebus.PostgreSql

:bus: PostgreSQL persistence for Rebus
https://mookid.dk/category/rebus
Other
17 stars 19 forks source link

Method not found Npgsql.NpgsqlDataReader Npgsql.NpgsqlCommand.ExecuteReader() error #27

Closed evgenyshugaev closed 2 years ago

evgenyshugaev commented 2 years ago

I need to use Rebus.PostgreSql with .net4 and npgsql 6.0.4. As I know in Rebus.PostgreSql is used npgsql 4.1.6. The trouble in difference betweeen method signatures NpgsqlCommand.ExecuteReader() from npgsql 4.1.6 and npgsql 6.0.4 And I've get an error: method not found Npgsql.NpgsqlDataReader Npgsql.NpgsqlCommand.ExecuteReader()

at Rebus.PostgreSql.PostgreSqlMagic.GetTableNames(PostgresConnection connection) at Rebus.PostgreSql.Transport.PostgreSqlTransport.d24.MoveNext() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Rebus.PostgreSql.Transport.PostgreSqlTransport.d23.MoveNext()

at Rebus.PostgreSql.Transport.PostgreSqlTransport.d23.MoveNext() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Rebus.Internals.AsyncHelpers.CustomSynchronizationContext.<b7_0>d.MoveNext() at Rebus.Internals.AsyncHelpers.CustomSynchronizationContext.Run() at Rebus.Internals.AsyncHelpers.RunSync(Func1 task) at Rebus.PostgreSql.Transport.PostgreSqlTransport.EnsureTableIsCreated() at Rebus.Config.PostgreSqlTransportConfigurationExtensions.<>c__DisplayClass4_0.<Configure>b__0(IResolutionContext context) at Rebus.Injection.Injectionist.Resolver1.InvokeResolver(IResolutionContext context) at Rebus.Injection.Injectionist.ResolutionContext.Get[TService]()

Woud you upgrade npgsql 4.1.6 to npgsql 6.0.4 in Rebus.PostgreSql with .net4?

here is my code:

                 var connectionHelper = new PostgresConnectionHelper(connectionString);

            Bus = Configure.With(Activator)
                    .Transport(t => t.UsePostgreSql(connectionHelper, SubscriptionsTable, queueName))
                    .Routing(r => r.TypeBased().Map<string>(queueName))
                    .Options(o =>
                    {
                        o.SetNumberOfWorkers(numberOfWorkers);
                        o.SetMaxParallelism(maxParallelism);
                        o.SetBackoffTimes(
                            TimeSpan.FromMilliseconds(500),
                            TimeSpan.FromMilliseconds(1000),
                            TimeSpan.FromMilliseconds(2000),
                            TimeSpan.FromMilliseconds(4000)
                        );
                    })
                    .Subscriptions(s => s.StoreInPostgres(connectionString, SubscriptionsTable))  //StoreInSqlServer(connectionString, SubscriptionsTable))
                    .Start();
mookid8000 commented 2 years ago

I've updated it to Npgsql 6.0.4 - it's on NuGet.org as Rebus.Postgresql 8.0.0 in a few minutes.

Thanks for making me aware of this issue 🙂

evgenyshugaev commented 2 years ago

Thank you. Now it works. But I got another problem: Rebus.PostgreSql does not support schema config like for ms sql server:

Configure.With(...) .Transport(t => t.UseSqlServer(connectionString, "my-queue") .WithSchema("rebus")) .Start();

and for this reason table custom.bus_queue not created. Can you add WithSchema("schrmaname") method to Configuration?